HomePhabricator

test: wallet_backup.py, fix intermittent failure in "restore using dumped…

Description

test: wallet_backup.py, fix intermittent failure in "restore using dumped wallet"

Summary:

The failure arises because the test expects 'init_wallet()' (the test
framework function) creating a wallet with no keys. However, the function also imports the deterministic private key used to receive the coinbase coins.

This causes a race within the "restore using dumped wallet" case, where we intend to have a new wallet (with no existing keys) to test the 'importwallet()' RPC result.
The reason behind the intermittent failures might be other peers delivering the chain right after node2 startup (sync of the validation queue included) and prior to the 'node2.getbalance()' check.

Backport of core#28325.

Test Plan:

./test/functional/test_runner.py wallet_backup

Reviewers: #bitcoin_abc, bytesofman

Reviewed By: #bitcoin_abc, bytesofman

Differential Revision: https://reviews.bitcoinabc.org/D16643

Event Timeline