For lightning payments tests, add small delay after creating the invoice before sending the payment

This commit is contained in:
nicolas.dorier
2018-10-29 00:22:30 +09:00
parent c1f17ff63b
commit d3b3198b68

View File

@@ -481,10 +481,6 @@ namespace BTCPayServer.Tests
async Task CanSendLightningPaymentCore(ServerTester tester, TestAccount user) async Task CanSendLightningPaymentCore(ServerTester tester, TestAccount user)
{ {
// TODO: If this parameter is less than 1 second we start having concurrency problems
await Task.Delay(TimeSpan.FromMilliseconds(1000));
//
var invoice = await user.BitPay.CreateInvoiceAsync(new Invoice() var invoice = await user.BitPay.CreateInvoiceAsync(new Invoice()
{ {
Price = 0.01m, Price = 0.01m,
@@ -493,6 +489,7 @@ namespace BTCPayServer.Tests
OrderId = "orderId", OrderId = "orderId",
ItemDesc = "Some description" ItemDesc = "Some description"
}); });
await Task.Delay(TimeSpan.FromMilliseconds(1000)); // Give time to listen the new invoices
await tester.SendLightningPaymentAsync(invoice); await tester.SendLightningPaymentAsync(invoice);
await EventuallyAsync(async () => await EventuallyAsync(async () =>
{ {