diff options
author | Seleme Topuz <seleme94@hotmail.com> | 2020-08-25 21:34:33 +0200 |
---|---|---|
committer | Seleme Topuz <seleme94@hotmail.com> | 2020-08-26 18:01:59 +0200 |
commit | d841301010914203fb5ef02627c76fad99cb11f1 (patch) | |
tree | 92cfb4ee2d9fdc6b3fa70cd767734c3a2409856a | |
parent | 1343c86c7cc1fc896696b3ed87c12039e4ef3a0c (diff) |
test: Add docstring to wait_until() in util.py to warn about its usage
-rw-r--r-- | test/functional/test_framework/util.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/functional/test_framework/util.py b/test/functional/test_framework/util.py index 3362b41209..cfc4ee65d4 100644 --- a/test/functional/test_framework/util.py +++ b/test/functional/test_framework/util.py @@ -226,6 +226,14 @@ def satoshi_round(amount): def wait_until(predicate, *, attempts=float('inf'), timeout=float('inf'), lock=None, timeout_factor=1.0): + """Sleep until the predicate resolves to be True. + + Warning: Note that this method is not recommended to be used in tests as it is + not aware of the context of the test framework. Using `wait_until()` counterpart + from `BitcoinTestFramework` or `P2PInterface` class ensures an understandable + amount of timeout and a common shared timeout_factor. Furthermore, `wait_until()` + from `P2PInterface` class in `mininode.py` has a preset lock. + """ if attempts == float('inf') and timeout == float('inf'): timeout = 60 timeout = timeout * timeout_factor |