Please describe the feature you’d like to see added.
Found several hardcoded time.sleep() calls in functional tests that waste CI time:
wallet_encryption.py:55- always sleeps 3s for timeout testp2p_leak.py:139- sleeps 5s waiting for peer timeoutfeature_dbcrash.py:96- 1s sleep in crash recovery- Framework sync functions default to 1s waits
These add up to significant overhead. For example, the wallet test could poll the wallet lock state instead of waiting 3 full seconds.
Proposal: Replace with wait_until() pattern already used elsewhere in the codebase. Should save 30+ minutes on full test runs.
Happy to work on this if there’s interest.
Is your feature related to a problem, if so please describe it.
Found several hardcoded time.sleep() calls in functional tests that waste CI time:
- wallet_encryption.py:55 - always sleeps 3s for timeout test
- p2p_leak.py:139 - sleeps 5s waiting for peer timeout
- feature_dbcrash.py:96 - 1s sleep in crash recovery
- Framework sync functions default to 1s waits
These add up to significant overhead across the test suite. The wallet test could poll the wallet lock state instead of waiting 3 full seconds every time.
Describe the solution you’d like
Replace hardcoded sleeps with the wait_until() pattern already used elsewhere in the codebase.
For example, instead of time.sleep(3) in the wallet test, poll the wallet lock status until the condition is met (with a timeout for safety).
Should save 30+ minutes on full test runs while maintaining the same reliability.
Describe any alternatives you’ve considered
Considered leaving things as it is, but the time waste is noticeable during development. Could also just reduce the hardcoded values, but smart polling is more robust.
Please leave any additional context
Happy to implement this if there’s interest. The wait_until() pattern is already used throughout the test framework, so this would just be applying it more consistently.