pacify the race detector in TestGossipsubFanoutExpiry
This commit is contained in:
parent
9b156866c6
commit
95071e955a
|
@ -297,16 +297,23 @@ func TestGossipsubFanoutExpiry(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(psubs[0].rt.(*GossipSubRouter).fanout) == 0 {
|
psubs[0].eval <- func() {
|
||||||
t.Fatal("owner has no fanout")
|
if len(psubs[0].rt.(*GossipSubRouter).fanout) == 0 {
|
||||||
|
t.Fatal("owner has no fanout")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// wait for TTL to expire fanout peers in owner
|
// wait for TTL to expire fanout peers in owner
|
||||||
time.Sleep(time.Second * 2)
|
time.Sleep(time.Second * 2)
|
||||||
|
|
||||||
if len(psubs[0].rt.(*GossipSubRouter).fanout) > 0 {
|
psubs[0].eval <- func() {
|
||||||
t.Fatal("fanout hasn't expired")
|
if len(psubs[0].rt.(*GossipSubRouter).fanout) > 0 {
|
||||||
|
t.Fatal("fanout hasn't expired")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// wait for it to run in the event loop
|
||||||
|
time.Sleep(10 * time.Millisecond)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestGossipsubGossip(t *testing.T) {
|
func TestGossipsubGossip(t *testing.T) {
|
||||||
|
|
Loading…
Reference in New Issue