From 1cbbfbe7fa32d64d4b4dc8100394f47c8a78f142 Mon Sep 17 00:00:00 2001 From: Péter Szilágyi Date: Tue, 9 Jun 2015 22:26:26 +0300 Subject: p2p: fix a close race in the dial test --- p2p/server_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/p2p/server_test.go b/p2p/server_test.go index 01448cc7b..e8d21a188 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 { -- cgit