mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-14 03:56:36 +00:00
eth: increase timeout in TestBroadcastBlock (#21299)
This commit is contained in:
parent
c16967c267
commit
5b1cfdef89
1 changed files with 6 additions and 3 deletions
|
|
@ -614,13 +614,16 @@ func testBroadcastBlock(t *testing.T, totalPeers, broadcastExpected int) {
|
||||||
select {
|
select {
|
||||||
case <-doneCh:
|
case <-doneCh:
|
||||||
received++
|
received++
|
||||||
|
if received > broadcastExpected {
|
||||||
case <-time.After(time.Second):
|
// We can bail early here
|
||||||
|
t.Errorf("broadcast count mismatch: have %d > want %d", received, broadcastExpected)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
case <-time.After(2 * time.Second):
|
||||||
if received != broadcastExpected {
|
if received != broadcastExpected {
|
||||||
t.Errorf("broadcast count mismatch: have %d, want %d", received, broadcastExpected)
|
t.Errorf("broadcast count mismatch: have %d, want %d", received, broadcastExpected)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
|
||||||
case err = <-errCh:
|
case err = <-errCh:
|
||||||
t.Fatalf("broadcast failed: %v", err)
|
t.Fatalf("broadcast failed: %v", err)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue