Make CanUseWebhooks less flaky

This commit is contained in:
nicolas.dorier 2022-01-13 13:21:54 +09:00
parent 7503fde48c
commit 2327b97fa3
No known key found for this signature in database
GPG Key ID: 6618763EF09186FE

View File

@ -804,8 +804,13 @@ namespace BTCPayServer.Tests
});
Assert.Null(hook.Secret);
AssertHook(fakeServer, hook);
var deliveries = await clientProfile.GetWebhookDeliveries(user.StoreId, hook.Id);
var delivery = Assert.Single(deliveries);
WebhookDeliveryData delivery = null;
await TestUtils.EventuallyAsync(async () =>
{
var deliveries = await clientProfile.GetWebhookDeliveries(user.StoreId, hook.Id);
delivery = Assert.Single(deliveries);
});
delivery = await clientProfile.GetWebhookDelivery(user.StoreId, hook.Id, delivery.Id);
Assert.NotNull(delivery);
Assert.Equal(WebhookDeliveryStatus.HttpSuccess, delivery.Status);