Skip to content

Commit dbc09b9

Browse files
Copilottzdybal
andcommitted
fix: use local timeout in TestStateOversizedBlock to avoid race conditions
Co-authored-by: tzdybal <[email protected]>
1 parent 54ae3ff commit dbc09b9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

consensus/state_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,14 @@ func TestStateBadProposal(t *testing.T) {
257257
}
258258

259259
func TestStateOversizedBlock(t *testing.T) {
260+
// Save original timeout and restore it after test to avoid race conditions
261+
// This test needs more time due to oversized block processing
262+
originalTimeout := ensureTimeout
263+
ensureTimeout = 500 * time.Millisecond
264+
defer func() {
265+
ensureTimeout = originalTimeout
266+
}()
267+
260268
const maxBytes = int64(types.BlockPartSizeBytes)
261269

262270
for _, testCase := range []struct {

0 commit comments

Comments
 (0)