forked from forks/go-ethereum
eth/catalyst: in tests, manually sync txpool after initial chain insertion to prevent race between txpool head reset and promotion of txs that will be subsequently added (#31595)
before this changes, this will result in numerous test failures: ``` > go test -run=Eth2AssembleBlock -c > stress ./catalyst.test ``` The reason is that after creating/inserting the test chain, there is a race between the txpool head reset and the promotion of txs added from tests. Ensuring that the txpool state is up to date with the head of the chain before proceeding fixes these flaky tests.
This commit is contained in:
parent
4906c99113
commit
9b4eab6a29
1 changed files with 3 additions and 0 deletions
|
|
@ -447,6 +447,9 @@ func startEthService(t *testing.T, genesis *core.Genesis, blocks []*types.Block)
|
|||
n.Close()
|
||||
t.Fatal("can't import test blocks:", err)
|
||||
}
|
||||
if err := ethservice.TxPool().Sync(); err != nil {
|
||||
t.Fatal("failed to sync txpool after initial blockchain import:", err)
|
||||
}
|
||||
|
||||
ethservice.SetSynced()
|
||||
return n, ethservice
|
||||
|
|
|
|||
Loading…
Reference in a new issue