mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-03 09:56:38 -05:00
Merge #20569: test: Fix intermittent wallet_multiwallet issue with got_loading_error
fab48da908
test: Fix intermittent wallet_multiwallet issue with got_loading_error (MarcoFalke)fa8e15f7b7
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 ACKfab48da908
. 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
This commit is contained in:
commit
9dbcd37105
1 changed files with 5 additions and 3 deletions
|
@ -23,9 +23,11 @@ from test_framework.util import (
|
||||||
)
|
)
|
||||||
|
|
||||||
got_loading_error = False
|
got_loading_error = False
|
||||||
|
|
||||||
|
|
||||||
def test_load_unload(node, name):
|
def test_load_unload(node, name):
|
||||||
global got_loading_error
|
global got_loading_error
|
||||||
for _ in range(10):
|
while True:
|
||||||
if got_loading_error:
|
if got_loading_error:
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
|
@ -68,7 +70,7 @@ class MultiWalletTest(BitcoinTestFramework):
|
||||||
return wallet_dir(name, "wallet.dat")
|
return wallet_dir(name, "wallet.dat")
|
||||||
return wallet_dir(name)
|
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
|
# check wallet.dat is created
|
||||||
self.stop_nodes()
|
self.stop_nodes()
|
||||||
|
@ -278,7 +280,7 @@ class MultiWalletTest(BitcoinTestFramework):
|
||||||
threads = []
|
threads = []
|
||||||
for _ in range(3):
|
for _ in range(3):
|
||||||
n = node.cli if self.options.usecli else get_rpc_proxy(node.url, 1, timeout=600, coveragedir=node.coverage_dir)
|
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()
|
t.start()
|
||||||
threads.append(t)
|
threads.append(t)
|
||||||
for t in threads:
|
for t in threads:
|
||||||
|
|
Loading…
Add table
Reference in a new issue