mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
ethclient: fix flaky test
This commit is contained in:
parent
6b0de79935
commit
4fb2259a58
2 changed files with 40 additions and 29 deletions
|
|
@ -689,6 +689,8 @@ type rpcProgress struct {
|
|||
HealedBytecodeBytes hexutil.Uint64
|
||||
HealingTrienodes hexutil.Uint64
|
||||
HealingBytecode hexutil.Uint64
|
||||
TxIndexFinishedBlocks hexutil.Uint64
|
||||
TxIndexRemainingBlocks hexutil.Uint64
|
||||
}
|
||||
|
||||
func (p *rpcProgress) toSyncProgress() *ethereum.SyncProgress {
|
||||
|
|
@ -713,5 +715,7 @@ func (p *rpcProgress) toSyncProgress() *ethereum.SyncProgress {
|
|||
HealedBytecodeBytes: uint64(p.HealedBytecodeBytes),
|
||||
HealingTrienodes: uint64(p.HealingTrienodes),
|
||||
HealingBytecode: uint64(p.HealingBytecode),
|
||||
TxIndexFinishedBlocks: uint64(p.TxIndexFinishedBlocks),
|
||||
TxIndexRemainingBlocks: uint64(p.TxIndexRemainingBlocks),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -231,6 +231,13 @@ func newTestBackend(t *testing.T) (*node.Node, []*types.Block) {
|
|||
if _, err := ethservice.BlockChain().InsertChain(blocks[1:]); err != nil {
|
||||
t.Fatalf("can't import test blocks: %v", err)
|
||||
}
|
||||
// Ensure the tx indexing is fully generated
|
||||
for ; ; time.Sleep(time.Millisecond * 100) {
|
||||
progress, err := ethservice.BlockChain().TxIndexProgress()
|
||||
if err == nil && progress.Done() {
|
||||
break
|
||||
}
|
||||
}
|
||||
return n, blocks
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue