diff options
author | Felix Lange <fjl@twurst.com> | 2015-06-10 04:00:49 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2015-06-10 04:00:49 +0800 |
commit | e972a116acb8755d9d70ad271cae2918869dcc3b (patch) | |
tree | e04a77e21332031bc4af8f82d0b7a7fe3fa9a72a | |
parent | 7e58949c3f4c67960fb0422f49f3e513a388cc5d (diff) | |
parent | 1cbbfbe7fa32d64d4b4dc8100394f47c8a78f142 (diff) | |
download | dexon-e972a116acb8755d9d70ad271cae2918869dcc3b.tar.gz dexon-e972a116acb8755d9d70ad271cae2918869dcc3b.tar.zst dexon-e972a116acb8755d9d70ad271cae2918869dcc3b.zip |
Merge pull request #1221 from karalabe/fix-p2p-dial-test
p2p: fix a close race in the dial test
-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 { |