aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2015-06-10 04:00:49 +0800
committerFelix Lange <fjl@twurst.com>2015-06-10 04:00:49 +0800
commite972a116acb8755d9d70ad271cae2918869dcc3b (patch)
treee04a77e21332031bc4af8f82d0b7a7fe3fa9a72a
parent7e58949c3f4c67960fb0422f49f3e513a388cc5d (diff)
parent1cbbfbe7fa32d64d4b4dc8100394f47c8a78f142 (diff)
downloadgo-tangerine-e972a116acb8755d9d70ad271cae2918869dcc3b.tar
go-tangerine-e972a116acb8755d9d70ad271cae2918869dcc3b.tar.gz
go-tangerine-e972a116acb8755d9d70ad271cae2918869dcc3b.tar.bz2
go-tangerine-e972a116acb8755d9d70ad271cae2918869dcc3b.tar.lz
go-tangerine-e972a116acb8755d9d70ad271cae2918869dcc3b.tar.xz
go-tangerine-e972a116acb8755d9d70ad271cae2918869dcc3b.tar.zst
go-tangerine-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.go3
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 {