Skip to content

Commit 9dbcd37

Browse files
author
MarcoFalke
committed
Merge #20569: test: Fix intermittent wallet_multiwallet issue with got_loading_error
fab48da test: Fix intermittent wallet_multiwallet issue with got_loading_error (MarcoFalke) fa8e15f 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 fab48da. This seems like a good workaround. I think more ideally think load and unload RPCs would not have racy status reporting (suggested previously bitcoin/bitcoin#19300 (review) and Tree-SHA512: 6b80b26d916276efe2a01af93bca7dbf71a3e67db9d3deb15175070719bf7d1325a1410d93e74c0316942e388faa2ba185dc9d3759c82d1c73c3c509b9997f05
2 parents 2d4eeaf + fab48da commit 9dbcd37

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

test/functional/wallet_multiwallet.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@
2323
)
2424

2525
got_loading_error = False
26+
27+
2628
def test_load_unload(node, name):
2729
global got_loading_error
28-
for _ in range(10):
30+
while True:
2931
if got_loading_error:
3032
return
3133
try:
@@ -68,7 +70,7 @@ def wallet_file(name):
6870
return wallet_dir(name, "wallet.dat")
6971
return wallet_dir(name)
7072

71-
assert_equal(self.nodes[0].listwalletdir(), { 'wallets': [{ 'name': self.default_wallet_name }] })
73+
assert_equal(self.nodes[0].listwalletdir(), {'wallets': [{'name': self.default_wallet_name}]})
7274

7375
# check wallet.dat is created
7476
self.stop_nodes()
@@ -278,7 +280,7 @@ def wallet_file(name):
278280
threads = []
279281
for _ in range(3):
280282
n = node.cli if self.options.usecli else get_rpc_proxy(node.url, 1, timeout=600, coveragedir=node.coverage_dir)
281-
t = Thread(target=test_load_unload, args=(n, wallet_names[2], ))
283+
t = Thread(target=test_load_unload, args=(n, wallet_names[2]))
282284
t.start()
283285
threads.append(t)
284286
for t in threads:

0 commit comments

Comments
 (0)