diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2018-03-19 17:10:29 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2018-03-19 17:13:51 +0100 |
commit | 93634f296e0b2281b25fdbbd5e608b2f5e662ea3 (patch) | |
tree | 4d467384afc67eb9b382b6419d33128f08cf1bdf /test/functional/feature_reindex.py | |
parent | c39dd2ef59c986576726cc356a27165486fd0d65 (diff) | |
parent | 9d7f839a206b7392aebfa436ae0f9a29d33d2960 (diff) |
Merge #12553: Prefer wait_until over polling with time.sleep
9d7f839a2 test: Use os.path.join consistently in feature_pruning tests (Ben Woosley)
81b082277 test: Use wait_until in tests where time was used for polling (Ben Woosley)
Pull request description:
This is prompted by and builds on #12545, a nice cleanup / consolidation of patterns.
In cases where the exception message was meaningful, I tried to represent it as well in a comment.
I expect #12545 will go in first, but I'm happy to squash them if that's preferred.
Tree-SHA512: 7a861244001c87fd6b59b6bc248ee741ac8178f7255d6f1fda39bc693c5ff3b7de5f53d13afe9829aef6ea69153481edb0a9d5bc07c36c4f66b4315edd180bb4
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): |