mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-13 03:26:38 +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 {
|
if err != nil {
|
||||||
return nil, nil, fmt.Errorf("can't create new ethereum service: %v", err)
|
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.
|
// Import the test chain.
|
||||||
if err := n.Start(); err != nil {
|
if err := n.Start(); err != nil {
|
||||||
return nil, nil, fmt.Errorf("can't start test node: %v", err)
|
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
|
// send a transaction for some interesting pending status
|
||||||
// and wait for the transaction to be included in the pending block
|
if err := sendTransaction(ec); err != nil {
|
||||||
sendTransaction(ec)
|
t.Fatalf("unexpected error: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
// wait for the transaction to be included in the pending block
|
// wait for the transaction to be included in the pending block
|
||||||
for {
|
for {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue