mirror of https://github.com/status-im/op-geth.git
Merge pull request #1221 from karalabe/fix-p2p-dial-test
p2p: fix a close race in the dial test
This commit is contained in:
commit
e972a116ac
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue