From a134f53f0b49e5daaac760b6a90545bd263e7cb5 Mon Sep 17 00:00:00 2001 From: hzq12177 Date: Wed, 19 Feb 2025 01:04:19 +0800 Subject: [PATCH] fix: improve TestSimulatedBeaconSendWithdrawals reliability (fixes #31169) - Reduced block generation period from 1s to 0.5s to speed up block production. - Increased test timeout from 12s to 30s to ensure completion. The changes prevent intermittent timeouts in the flaky test while maintaining the test's original logic. --- eth/catalyst/simulated_beacon_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/eth/catalyst/simulated_beacon_test.go b/eth/catalyst/simulated_beacon_test.go index 79d9ba738e..e8696a604c 100644 --- a/eth/catalyst/simulated_beacon_test.go +++ b/eth/catalyst/simulated_beacon_test.go @@ -86,7 +86,8 @@ func TestSimulatedBeaconSendWithdrawals(t *testing.T) { // short period (1 second) for testing purposes var gasLimit uint64 = 10_000_000 genesis := core.DeveloperGenesisBlock(gasLimit, &testAddr) - node, ethService, mock := startSimulatedBeaconEthService(t, genesis, 1) + // Increase block generation frequency by reducing the period to 0.5 seconds + node, ethService, mock := startSimulatedBeaconEthService(t, genesis, 0.5) _ = mock defer node.Close() @@ -119,7 +120,8 @@ func TestSimulatedBeaconSendWithdrawals(t *testing.T) { includedTxs := make(map[common.Hash]struct{}) var includedWithdrawals []uint64 - timer := time.NewTimer(12 * time.Second) + // Increase timeout to 30 seconds to ensure the test has enough time to complete + timer := time.NewTimer(30 * time.Second) for { select { case ev := <-chainHeadCh: