diff options
author | Péter Szilágyi <peterke@gmail.com> | 2015-06-10 03:26:26 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2015-06-10 03:26:26 +0800 |
commit | 1cbbfbe7fa32d64d4b4dc8100394f47c8a78f142 (patch) | |
tree | e04a77e21332031bc4af8f82d0b7a7fe3fa9a72a /p2p | |
parent | 7e58949c3f4c67960fb0422f49f3e513a388cc5d (diff) | |
download | go-tangerine-1cbbfbe7fa32d64d4b4dc8100394f47c8a78f142.tar.gz go-tangerine-1cbbfbe7fa32d64d4b4dc8100394f47c8a78f142.tar.zst go-tangerine-1cbbfbe7fa32d64d4b4dc8100394f47c8a78f142.zip |
p2p: fix a close race in the dial test
Diffstat (limited to 'p2p')
-rw-r--r-- | p2p/server_test.go | 3 |
1 files changed, 2 insertions, 1 deletions
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 { |