From 6858b1e1b26ebcd9f4035ceaa8762055938e91e2 Mon Sep 17 00:00:00 2001 From: "Johan T. Halseth" Date: Wed, 9 Aug 2017 11:17:24 +0200 Subject: [PATCH] integration tests: add sleep before opening second channel. In the "multiple channel creation" test, in some cases the responder (Bob) was not yet considering the first channel to be opened (activeReservation still not deleted in fundingManager) when Alice tried to open the second channel. This would cause the test to fail. This commit adds a small sleep before the creation of the second channel, to give Bob some time to finish the opening process. --- lnd_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lnd_test.go b/lnd_test.go index a006a7ed0..8a95a2976 100644 --- a/lnd_test.go +++ b/lnd_test.go @@ -1538,6 +1538,12 @@ func testBasicChannelCreation(net *networkHarness, t *harnessTest) { ctx, _ := context.WithTimeout(context.Background(), timeout) chanPoints[i] = openChannelAndAssert(ctx, t, net, net.Alice, net.Bob, amount, 0) + + // We need to give Bob a bit of time to make sure the newly + // opened channel is not still pending. + if i != numChannels-1 { + time.Sleep(time.Millisecond * 500) + } } // Close the channel between Alice and Bob, asserting that the