From 4c28cc75df5cc8584b0c741d4f5ac72f4b8f76e8 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 4 Jul 2019 13:08:28 -0700 Subject: [PATCH] test: fix test fallout from notify push --- p2p/host/basic/basic_host_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/p2p/host/basic/basic_host_test.go b/p2p/host/basic/basic_host_test.go index 56120db846..acc1db85f6 100644 --- a/p2p/host/basic/basic_host_test.go +++ b/p2p/host/basic/basic_host_test.go @@ -209,6 +209,8 @@ func TestHostProtoPreference(t *testing.T) { t.Fatal(err) } + // XXX: This is racy now that we push protocol updates. If this tests + // fails, try allowing both protoOld and protoMinor. assertWait(t, connectedOn, protoOld) s2.Close() @@ -218,6 +220,12 @@ func TestHostProtoPreference(t *testing.T) { t.Fatal(err) } + // Force a lazy handshake as we may have received a protocol update by this point. + _, err = s3.Write([]byte("hello")) + if err != nil { + t.Fatal(err) + } + assertWait(t, connectedOn, protoMinor) s3.Close() }