From dfa348f8062ee5279bb3f6a1a15ab30f6e092672 Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Sun, 3 Sep 2023 12:30:49 +0700 Subject: [PATCH] holepunch: fix assertion in test --- p2p/protocol/holepunch/holepunch_test.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/p2p/protocol/holepunch/holepunch_test.go b/p2p/protocol/holepunch/holepunch_test.go index 29d589cd7a..832603a2b8 100644 --- a/p2p/protocol/holepunch/holepunch_test.go +++ b/p2p/protocol/holepunch/holepunch_test.go @@ -341,9 +341,10 @@ func TestFailuresOnResponder(t *testing.T) { defer relay.Close() s, err := h2.NewStream(network.WithUseTransient(context.Background(), "holepunch"), h1.ID(), holepunch.Protocol) - require.NoError(t, err) - - go tc.initiator(s) + // h1 will reset the stream. This might or might not happen before multistream has finished. + if err == nil { + go tc.initiator(s) + } getTracerError := func(tr *mockEventTracer) []string { var errs []string