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

@@ -16,10 +16,8 @@ import sys
import tempfile
import urllib
from test_framework.test_framework import (
BitcoinTestFramework,
)
from test_framework.util import assert_equal, wait_until
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal
class LoadblockTest(BitcoinTestFramework):
@@ -75,7 +73,7 @@ class LoadblockTest(BitcoinTestFramework):
self.log.info("Restart second, unsynced node with bootstrap file")
self.stop_node(1)
self.start_node(1, ["-loadblock=" + bootstrap_file])
wait_until(lambda: self.nodes[1].getblockcount() == 100)
assert_equal(self.nodes[1].getblockcount(), 100) # start_node is blocking on all block files being imported
assert_equal(self.nodes[1].getblockchaininfo()['blocks'], 100)
assert_equal(self.nodes[0].getbestblockhash(), self.nodes[1].getbestblockhash())