From 6fef558dfa13f3ee60604f93ad9f61cef0b92444 Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Mon, 18 Apr 2022 21:57:03 +0100 Subject: [PATCH 1/2] don't run the reconnect test using TCP on OSX Due to https://github.com/golang/go/issues/50254. --- p2p/test/reconnects/reconnect_test.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/p2p/test/reconnects/reconnect_test.go b/p2p/test/reconnects/reconnect_test.go index 12fdb36780..721f7a6799 100644 --- a/p2p/test/reconnects/reconnect_test.go +++ b/p2p/test/reconnects/reconnect_test.go @@ -4,6 +4,7 @@ import ( "context" "io" "math/rand" + "runtime" "sync" "testing" "time" @@ -49,6 +50,9 @@ func TestReconnect5(t *testing.T) { } t.Run("using TCP", func(t *testing.T) { + if runtime.GOOS == "darwin" { + t.Skip("TCP RST handling is flaky in OSX, see https://github.com/golang/go/issues/50254") + } runTest(t, swarmt.OptDisableQUIC) }) @@ -121,5 +125,5 @@ func runRound(t *testing.T, hosts []host.Host) { } } return true - }, 500*time.Millisecond, 10*time.Millisecond) + }, 5000*time.Millisecond, 10*time.Millisecond) } From 71f8bb6baff84ac5f27cdb4d7d75860dbd45088e Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Mon, 18 Apr 2022 21:57:43 +0100 Subject: [PATCH 2/2] don't check the error return value when closing stream in reconnect test --- p2p/test/reconnects/reconnect_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/p2p/test/reconnects/reconnect_test.go b/p2p/test/reconnects/reconnect_test.go index 721f7a6799..0d71ec5c02 100644 --- a/p2p/test/reconnects/reconnect_test.go +++ b/p2p/test/reconnects/reconnect_test.go @@ -95,9 +95,9 @@ func runRound(t *testing.T, hosts []host.Host) { rand.Read(data) str, err := h1.NewStream(context.Background(), h2.ID(), protocol.TestingID) require.NoError(t, err) + defer str.Close() _, err = str.Write(data) require.NoError(t, err) - require.NoError(t, str.Close()) }() } wg.Wait()