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() }