aboutsummaryrefslogtreecommitdiffstats
path: root/p2p/peer_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'p2p/peer_test.go')
-rw-r--r--p2p/peer_test.go13
1 files changed, 7 insertions, 6 deletions
diff --git a/p2p/peer_test.go b/p2p/peer_test.go
index fb76818a0..7d17d447c 100644
--- a/p2p/peer_test.go
+++ b/p2p/peer_test.go
@@ -172,12 +172,13 @@ func TestPeerDisconnect(t *testing.T) {
if err := SendItems(rw, discMsg, DiscQuitting); err != nil {
t.Fatal(err)
}
- if err := ExpectMsg(rw, discMsg, []interface{}{DiscRequested}); err != nil {
- t.Error(err)
- }
- closer()
- if reason := <-disc; reason != DiscRequested {
- t.Errorf("run returned wrong reason: got %v, want %v", reason, DiscRequested)
+ select {
+ case reason := <-disc:
+ if reason != DiscQuitting {
+ t.Errorf("run returned wrong reason: got %v, want %v", reason, DiscRequested)
+ }
+ case <-time.After(500 * time.Millisecond):
+ t.Error("peer did not return")
}
}