mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-29 18:20:58 +02:00
test: Use wait_until in tests where time was used for polling
This commit is contained in:
@ -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):
|
||||
|
Reference in New Issue
Block a user