From 39304c883f6d918fe11bb4115cb6a0a6c54ec1e1 Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Mon, 25 Apr 2022 18:36:02 +0100 Subject: [PATCH] swarm: don't check return value of str.Close in TestResourceManager (#1453) If the stream was canceled, QUIC will return an error when calling Close. --- p2p/net/swarm/swarm_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/p2p/net/swarm/swarm_test.go b/p2p/net/swarm/swarm_test.go index 5e4fa2ec6..2218b821b 100644 --- a/p2p/net/swarm/swarm_test.go +++ b/p2p/net/swarm/swarm_test.go @@ -481,6 +481,7 @@ func TestResourceManager(t *testing.T) { rcmgr2.EXPECT().OpenStream(s1.LocalPeer(), network.DirInbound).Return(streamScope2, nil) str, err := s1.NewStream(context.Background(), s2.LocalPeer()) require.NoError(t, err) + defer str.Close() str.Write([]byte("foobar")) p := protocol.ID("proto") @@ -491,7 +492,6 @@ func TestResourceManager(t *testing.T) { streamScope2.EXPECT().Done() require.NoError(t, sstr.Close()) streamScope1.EXPECT().Done() - require.NoError(t, str.Close()) } func TestResourceManagerNewStream(t *testing.T) {