From 0aa4d723e5c33736953e2c02c139e829f6828fe9 Mon Sep 17 00:00:00 2001 From: Malta Micael Date: Sun, 30 May 2021 22:04:41 -0400 Subject: [PATCH] fix: reduce tests latency Non-necessary long time sleep for sync_blocks and sync_mempools. --- test/functional/test_framework/test_framework.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/functional/test_framework/test_framework.py b/test/functional/test_framework/test_framework.py index f42f279cc..79106a39e 100755 --- a/test/functional/test_framework/test_framework.py +++ b/test/functional/test_framework/test_framework.py @@ -42,6 +42,8 @@ class TestStatus(Enum): TEST_EXIT_PASSED = 0 TEST_EXIT_FAILED = 1 TEST_EXIT_SKIPPED = 77 +# REDUCE WAIT LATENCY +DEFAULT_WAIT = .1 TMPDIR_PREFIX = "bitcoin_func_test_" @@ -597,7 +599,7 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass): self.connect_nodes(1, 2) self.sync_all() - def sync_blocks(self, nodes=None, wait=1, timeout=60): + def sync_blocks(self, nodes=None, wait=DEFAULT_WAIT, timeout=60): """ Wait until everybody has the same tip. sync_blocks needs to be called with an rpc_connections set that has least @@ -619,7 +621,7 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass): "".join("\n {!r}".format(b) for b in best_hash), )) - def sync_mempools(self, nodes=None, wait=1, timeout=60, flush_scheduler=True): + def sync_mempools(self, nodes=None, wait=DEFAULT_WAIT, timeout=60, flush_scheduler=True): """ Wait until everybody has the same transactions in their memory pools