aboutsummaryrefslogtreecommitdiff
path: root/test/functional/feature_reindex.py
diff options
context:
space:
mode:
authorBen Woosley <ben.woosley@gmail.com>2018-02-26 14:04:41 -0800
committerBen Woosley <ben.woosley@gmail.com>2018-03-15 23:43:53 -0700
commit81b0822772169cb697b5994f49398e619d61a12d (patch)
tree5fa33497ba61f9ab4f14be747aed72225149966d /test/functional/feature_reindex.py
parent7be9a9a570c1140048f8781ced1111e1d930e517 (diff)
downloadbitcoin-81b0822772169cb697b5994f49398e619d61a12d.tar.xz
test: Use wait_until in tests where time was used for polling
Diffstat (limited to 'test/functional/feature_reindex.py')
-rwxr-xr-xtest/functional/feature_reindex.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/test/functional/feature_reindex.py b/test/functional/feature_reindex.py
index ac67e6e9ba..d1d3f1d7f1 100755
--- a/test/functional/feature_reindex.py
+++ b/test/functional/feature_reindex.py
@@ -10,8 +10,7 @@
"""
from test_framework.test_framework import BitcoinTestFramework
-from test_framework.util import assert_equal
-import time
+from test_framework.util import wait_until
class ReindexTest(BitcoinTestFramework):
@@ -25,9 +24,7 @@ class ReindexTest(BitcoinTestFramework):
self.stop_nodes()
extra_args = [["-reindex-chainstate" if justchainstate else "-reindex", "-checkblockindex=1"]]
self.start_nodes(extra_args)
- while self.nodes[0].getblockcount() < blockcount:
- time.sleep(0.1)
- assert_equal(self.nodes[0].getblockcount(), blockcount)
+ wait_until(lambda: self.nodes[0].getblockcount() == blockcount)
self.log.info("Success")
def run_test(self):