diff options
author | Ben Woosley <ben.woosley@gmail.com> | 2018-02-26 14:04:41 -0800 |
---|---|---|
committer | Ben Woosley <ben.woosley@gmail.com> | 2018-03-15 23:43:53 -0700 |
commit | 81b0822772169cb697b5994f49398e619d61a12d (patch) | |
tree | 5fa33497ba61f9ab4f14be747aed72225149966d /test/functional/feature_reindex.py | |
parent | 7be9a9a570c1140048f8781ced1111e1d930e517 (diff) |
test: Use wait_until in tests where time was used for polling
Diffstat (limited to 'test/functional/feature_reindex.py')
-rwxr-xr-x | test/functional/feature_reindex.py | 7 |
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): |