mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-28 22:08:01 +08:00
make test fail instead of hang
This commit is contained in:
parent
00516299dd
commit
1a7fac4551
@ -431,6 +431,15 @@ func TestConnectCollision(t *testing.T) {
|
||||
done <- struct{}{}
|
||||
}()
|
||||
|
||||
<-done
|
||||
<-done
|
||||
timeout := time.After(time.Second * 5)
|
||||
select {
|
||||
case <-done:
|
||||
case <-timeout:
|
||||
t.Fatal("Timeout received!")
|
||||
}
|
||||
select {
|
||||
case <-done:
|
||||
case <-timeout:
|
||||
t.Fatal("Timeout received!")
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user