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.
This commit is contained in:
Johan T. Halseth 2017-08-09 11:17:24 +02:00 committed by Olaoluwa Osuntokun
parent 5c89ec6288
commit 6858b1e1b2

@ -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