mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-02-26 15:47:21 +00:00
ethclient: fix flaky pending tx test (#32380)
Fixes: https://github.com/ethereum/go-ethereum/issues/32252
This commit is contained in:
parent
c3ef6c77c2
commit
8ba1c791bf
1 changed files with 9 additions and 2 deletions
|
|
@ -110,6 +110,12 @@ func newTestBackend(config *node.Config) (*node.Node, []*types.Block, error) {
|
|||
if err != nil {
|
||||
return nil, nil, fmt.Errorf("can't create new ethereum service: %v", err)
|
||||
}
|
||||
// Ensure tx pool starts the background operation
|
||||
txPool := ethservice.TxPool()
|
||||
if err = txPool.Sync(); err != nil {
|
||||
return nil, nil, fmt.Errorf("can't sync transaction pool: %v", err)
|
||||
}
|
||||
|
||||
// Import the test chain.
|
||||
if err := n.Start(); err != nil {
|
||||
return nil, nil, fmt.Errorf("can't start test node: %v", err)
|
||||
|
|
@ -506,8 +512,9 @@ func testAtFunctions(t *testing.T, client *rpc.Client) {
|
|||
}
|
||||
|
||||
// send a transaction for some interesting pending status
|
||||
// and wait for the transaction to be included in the pending block
|
||||
sendTransaction(ec)
|
||||
if err := sendTransaction(ec); err != nil {
|
||||
t.Fatalf("unexpected error: %v", err)
|
||||
}
|
||||
|
||||
// wait for the transaction to be included in the pending block
|
||||
for {
|
||||
|
|
|
|||
Loading…
Reference in a new issue