Merge pull request #1221 from karalabe/fix-p2p-dial-test

p2p: fix a close race in the dial test
pull/1230/head
Felix Lange 10 years ago
commit e972a116ac
  1. 3
      p2p/server_test.go

@ -117,7 +117,6 @@ func TestServerDial(t *testing.T) {
t.Error("accept error:", err) t.Error("accept error:", err)
return return
} }
conn.Close()
accepted <- conn accepted <- conn
}() }()
@ -134,6 +133,8 @@ func TestServerDial(t *testing.T) {
select { select {
case conn := <-accepted: case conn := <-accepted:
defer conn.Close()
select { select {
case peer := <-connected: case peer := <-connected:
if peer.ID() != remid { if peer.ID() != remid {

Loading…
Cancel
Save