mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 15:16:43 +00:00
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.
This commit is contained in:
parent
864e717b56
commit
a134f53f0b
1 changed files with 4 additions and 2 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in a new issue