diff --git a/p2p/server_test.go b/p2p/server_test.go index 01448cc7bb..e8d21a188d 100644 --- a/p2p/server_test.go +++ b/p2p/server_test.go @@ -117,7 +117,6 @@ func TestServerDial(t *testing.T) { t.Error("accept error:", err) return } - conn.Close() accepted <- conn }() @@ -134,6 +133,8 @@ func TestServerDial(t *testing.T) { select { case conn := <-accepted: + defer conn.Close() + select { case peer := <-connected: if peer.ID() != remid {