test: Fix intermittent sync_blocks failures

This commit is contained in:
MarcoFalke
2020-05-04 20:06:38 -04:00
parent e727c2bdca
commit fa3f9a0566
6 changed files with 42 additions and 26 deletions

View File

@ -10,10 +10,10 @@
"""
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import wait_until
from test_framework.util import assert_equal
class ReindexTest(BitcoinTestFramework):
def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 1
@ -24,7 +24,7 @@ class ReindexTest(BitcoinTestFramework):
self.stop_nodes()
extra_args = [["-reindex-chainstate" if justchainstate else "-reindex"]]
self.start_nodes(extra_args)
wait_until(lambda: self.nodes[0].getblockcount() == blockcount)
assert_equal(self.nodes[0].getblockcount(), blockcount) # start_node is blocking on reindex
self.log.info("Success")
def run_test(self):