mirror of
https://github.com/FlipsideCrypto/dcrd.git
synced 2026-02-06 10:56:47 +00:00
peer: Ensure listener tests sync with messages.
This adds an additional read from the ok channel in the peer listener tests to ensure the version message is consumed as well as the verack so that the remaining tests line up with the messages that are being tested.
This commit is contained in:
parent
2d09391768
commit
fefb993956
@ -426,11 +426,18 @@ func TestPeerListeners(t *testing.T) {
|
||||
select {
|
||||
case <-verack:
|
||||
case <-time.After(time.Second * 1):
|
||||
t.Errorf("TestPeerListeners: verack timeout\n")
|
||||
t.Error("TestPeerListeners: verack timeout\n")
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
select {
|
||||
case <-ok:
|
||||
case <-time.After(time.Second * 1):
|
||||
t.Error("TestPeerListeners: version timeout")
|
||||
return
|
||||
}
|
||||
|
||||
tests := []struct {
|
||||
listener string
|
||||
msg wire.Message
|
||||
|
||||
Loading…
Reference in New Issue
Block a user