diff options
author | MarcoFalke <falke.marco@gmail.com> | 2020-12-16 15:47:15 +0100 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2020-12-16 15:47:23 +0100 |
commit | 9dbcd37105212d0fa7a1f0657e31de013fd93a16 (patch) | |
tree | 13bea2bdcd2db05b63dbb568e9d4d0bc4942eb59 /test | |
parent | 2d4eeaf9c5883dba2ecd04f1cc9da08bf7cf73bd (diff) | |
parent | fab48da908f3f81135b9163edf5011d1e5f6ef6e (diff) | |
download | bitcoin-9dbcd37105212d0fa7a1f0657e31de013fd93a16.tar.xz |
Merge #20569: test: Fix intermittent wallet_multiwallet issue with got_loading_error
fab48da908f3f81135b9163edf5011d1e5f6ef6e test: Fix intermittent wallet_multiwallet issue with got_loading_error (MarcoFalke)
fa8e15f7b75e35846b86e8627a3612e31eb22dcb test: pep8 wallet_multiwallet.py (MarcoFalke)
Pull request description:
Failing the test after 10 iterations without a loading error is problematic because it may take 11 iterations to get a loading error.
Fix that by running until a loading error occurs, which should happen in almost all runs within the first 10 iterations.
ACKs for top commit:
ryanofsky:
Code review ACK fab48da908f3f81135b9163edf5011d1e5f6ef6e. This seems like a good workaround. I think more ideally think load and unload RPCs would not have racy status reporting (suggested previously https://github.com/bitcoin/bitcoin/pull/19300#pullrequestreview-435362710 and
Tree-SHA512: 6b80b26d916276efe2a01af93bca7dbf71a3e67db9d3deb15175070719bf7d1325a1410d93e74c0316942e388faa2ba185dc9d3759c82d1c73c3c509b9997f05
Diffstat (limited to 'test')
-rwxr-xr-x | test/functional/wallet_multiwallet.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/test/functional/wallet_multiwallet.py b/test/functional/wallet_multiwallet.py index fb4532bcf6..bb89e76a9a 100755 --- a/test/functional/wallet_multiwallet.py +++ b/test/functional/wallet_multiwallet.py @@ -23,9 +23,11 @@ from test_framework.util import ( ) got_loading_error = False + + def test_load_unload(node, name): global got_loading_error - for _ in range(10): + while True: if got_loading_error: return try: @@ -68,7 +70,7 @@ class MultiWalletTest(BitcoinTestFramework): return wallet_dir(name, "wallet.dat") return wallet_dir(name) - assert_equal(self.nodes[0].listwalletdir(), { 'wallets': [{ 'name': self.default_wallet_name }] }) + assert_equal(self.nodes[0].listwalletdir(), {'wallets': [{'name': self.default_wallet_name}]}) # check wallet.dat is created self.stop_nodes() @@ -278,7 +280,7 @@ class MultiWalletTest(BitcoinTestFramework): threads = [] for _ in range(3): n = node.cli if self.options.usecli else get_rpc_proxy(node.url, 1, timeout=600, coveragedir=node.coverage_dir) - t = Thread(target=test_load_unload, args=(n, wallet_names[2], )) + t = Thread(target=test_load_unload, args=(n, wallet_names[2])) t.start() threads.append(t) for t in threads: |