Skip to content

Commit 5b1cfde

Browse files
authored
eth: increase timeout in TestBroadcastBlock (#21299)
1 parent c16967c commit 5b1cfde

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

eth/handler_test.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -614,13 +614,16 @@ func testBroadcastBlock(t *testing.T, totalPeers, broadcastExpected int) {
614614
select {
615615
case <-doneCh:
616616
received++
617-
618-
case <-time.After(time.Second):
617+
if received > broadcastExpected {
618+
// We can bail early here
619+
t.Errorf("broadcast count mismatch: have %d > want %d", received, broadcastExpected)
620+
return
621+
}
622+
case <-time.After(2 * time.Second):
619623
if received != broadcastExpected {
620624
t.Errorf("broadcast count mismatch: have %d, want %d", received, broadcastExpected)
621625
}
622626
return
623-
624627
case err = <-errCh:
625628
t.Fatalf("broadcast failed: %v", err)
626629
}

0 commit comments

Comments
 (0)