test: in testUpdateChannelPolicy wait for Alice to learn of all channels

In this commit, we fix an existing flake in the integration tests. If it
was the case that Alice didn't yet know of all the channels, then the
payment attempt below would fail at times, depending on other timing
factors in the test. We fix this flake by waiting for Alice to learn of
all channels before we proceed to the actual testing logic.
This commit is contained in:
Olaoluwa Osuntokun 2018-04-13 15:35:54 -07:00
parent 5f0d07e485
commit 4bf86aab27
No known key found for this signature in database
GPG Key ID: 964EA263DD637C21

@ -547,6 +547,10 @@ func testUpdateChannelPolicy(net *lntest.NetworkHarness, t *harnessTest) {
chanAmt, pushAmt) chanAmt, pushAmt)
ctxt, _ = context.WithTimeout(ctxb, time.Second*15) ctxt, _ = context.WithTimeout(ctxb, time.Second*15)
err = net.Alice.WaitForNetworkChannelOpen(ctxt, chanPoint2)
if err != nil {
t.Fatalf("alice didn't report channel: %v", err)
}
err = net.Bob.WaitForNetworkChannelOpen(ctxt, chanPoint2) err = net.Bob.WaitForNetworkChannelOpen(ctxt, chanPoint2)
if err != nil { if err != nil {
t.Fatalf("bob didn't report channel: %v", err) t.Fatalf("bob didn't report channel: %v", err)