Skip to content

Commit f7526ef

Browse files
committed
test: reduce delay in wait_until from 0.5s to 0.05s
Same delay is used for Bitcoin Core. Though, it can be appliable directly for each usages such as quorum generation or waiting for IS lock. It happends because some functional tests not only waiting during delay, but also does something strange such as bumping mocktime or generating new blocks. Also, some works during quorum generation are assuming to be done while we waiting, but it's not properly validated after delay, just assumed as it is done.
1 parent 34d9382 commit f7526ef

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

test/functional/test_framework/test_framework.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -898,7 +898,7 @@ def _initialize_mocktime(self, is_genesis):
898898
for node in self.nodes:
899899
node.mocktime = self.mocktime
900900

901-
def wait_until(self, test_function, timeout=60, lock=None, sleep=0.5, do_assert=True):
901+
def wait_until(self, test_function, timeout=60, lock=None, sleep=0.05, do_assert=True):
902902
return wait_until_helper(test_function, timeout=timeout, lock=lock, timeout_factor=self.options.timeout_factor, sleep=sleep, do_assert=do_assert)
903903

904904
# Private helper methods. These should not be accessed by the subclass test scripts.

test/functional/test_framework/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ def satoshi_round(amount):
247247
return Decimal(amount).quantize(Decimal('0.00000001'), rounding=ROUND_DOWN)
248248

249249

250-
def wait_until_helper(predicate, *, attempts=float('inf'), timeout=float('inf'), sleep=0.5, timeout_factor=1.0, lock=None, do_assert=True, allow_exception=False):
250+
def wait_until_helper(predicate, *, attempts=float('inf'), timeout=float('inf'), sleep=0.05, timeout_factor=1.0, lock=None, do_assert=True, allow_exception=False):
251251
"""Sleep until the predicate resolves to be True.
252252
253253
Warning: Note that this method is not recommended to be used in tests as it is

0 commit comments

Comments
 (0)