Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F12428732
D10684.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
944 B
Subscribers
None
D10684.diff
View Options
diff --git a/test/functional/wallet_multiwallet.py b/test/functional/wallet_multiwallet.py
--- a/test/functional/wallet_multiwallet.py
+++ b/test/functional/wallet_multiwallet.py
@@ -24,11 +24,10 @@
got_loading_error = False
-def test_load_unload(node, name):
+def test_load_unload(node, name, timeout=60.):
global got_loading_error
- for _ in range(10):
- if got_loading_error:
- return
+ t0 = time.time()
+ while time.time() - t0 < timeout and not got_loading_error:
try:
node.loadwallet(name)
node.unloadwallet(name)
@@ -37,6 +36,9 @@
4 and 'Wallet already being loading' in e.error['message']:
got_loading_error = True
return
+ # Add a small sleep to avoid CPU exhaustion in the unlikely case
+ # the race never happens.
+ time.sleep(0.001)
class MultiWalletTest(BitcoinTestFramework):
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 28, 19:27 (7 h, 58 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4844944
Default Alt Text
D10684.diff (944 B)
Attached To
D10684: test: Fix intermittent wallet_multiwallet issue with got_loading_error
Event Timeline
Log In to Comment