aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/network/simulation/events_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'swarm/network/simulation/events_test.go')
-rw-r--r--swarm/network/simulation/events_test.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/swarm/network/simulation/events_test.go b/swarm/network/simulation/events_test.go
index 34ef24ed4..529844816 100644
--- a/swarm/network/simulation/events_test.go
+++ b/swarm/network/simulation/events_test.go
@@ -81,6 +81,7 @@ func TestPeerEventsTimeout(t *testing.T) {
events := sim.PeerEvents(ctx, sim.NodeIDs())
done := make(chan struct{})
+ errC := make(chan error)
go func() {
for e := range events {
if e.Error == context.Canceled {
@@ -90,14 +91,16 @@ func TestPeerEventsTimeout(t *testing.T) {
close(done)
return
} else {
- t.Fatal(e.Error)
+ errC <- e.Error
}
}
}()
select {
case <-time.After(time.Second):
- t.Error("no context deadline received")
+ t.Fatal("no context deadline received")
+ case err := <-errC:
+ t.Fatal(err)
case <-done:
// all good, context deadline detected
}