From 4bf86aab27dd776abbbdf0aa4dee7f1b77a687be Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Fri, 13 Apr 2018 15:35:54 -0700 Subject: [PATCH] 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. --- lnd_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lnd_test.go b/lnd_test.go index 53c4f46b..6f9d476a 100644 --- a/lnd_test.go +++ b/lnd_test.go @@ -547,6 +547,10 @@ func testUpdateChannelPolicy(net *lntest.NetworkHarness, t *harnessTest) { chanAmt, pushAmt) 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) if err != nil { t.Fatalf("bob didn't report channel: %v", err)