mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-15 12:51:00 +02:00
test: disable "is everyone connected" check in sync_all in blocksigner test
Everyone is _not_ connected in this test, so on slow machines where this check triggers (e.g. the CI boxes) the test incorrectly fails. This was also a source of (very infrequent) spurious failures during the rebase.
This commit is contained in:
parent
89926e6b5f
commit
55be2930fb
2 changed files with 6 additions and 6 deletions
|
|
@ -171,7 +171,7 @@ class BlockSignTest(BitcoinTestFramework):
|
|||
self.nodes[i].submitblock(result["hex"])
|
||||
|
||||
# All nodes should be synced in blocks and transactions(mempool should be empty)
|
||||
self.sync_all()
|
||||
self.sync_all(expect_disconnected=True)
|
||||
|
||||
def mine_blocks(self, num_blocks, transactions):
|
||||
for i in range(num_blocks):
|
||||
|
|
|
|||
|
|
@ -604,7 +604,7 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
|
|||
self.connect_nodes(1, 2)
|
||||
self.sync_all()
|
||||
|
||||
def sync_blocks(self, nodes=None, wait=1, timeout=60):
|
||||
def sync_blocks(self, nodes=None, wait=1, timeout=60, expect_disconnected=False):
|
||||
"""
|
||||
Wait until everybody has the same tip.
|
||||
sync_blocks needs to be called with an rpc_connections set that has least
|
||||
|
|
@ -618,8 +618,8 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
|
|||
best_hash = [x.getbestblockhash() for x in rpc_connections]
|
||||
if best_hash.count(best_hash[0]) == len(rpc_connections):
|
||||
return
|
||||
# Check that each peer has at least one connection
|
||||
assert (all([len(x.getpeerinfo()) for x in rpc_connections]))
|
||||
if not expect_disconnected:
|
||||
assert (all([len(x.getpeerinfo()) for x in rpc_connections]))
|
||||
time.sleep(wait)
|
||||
raise AssertionError("Block sync timed out after {}s:{}".format(
|
||||
timeout,
|
||||
|
|
@ -649,8 +649,8 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
|
|||
"".join("\n {!r}".format(m) for m in pool),
|
||||
))
|
||||
|
||||
def sync_all(self, nodes=None):
|
||||
self.sync_blocks(nodes)
|
||||
def sync_all(self, nodes=None, expect_disconnected=False):
|
||||
self.sync_blocks(nodes, expect_disconnected=expect_disconnected)
|
||||
self.sync_mempools(nodes)
|
||||
|
||||
def wait_until(self, test_function, timeout=60):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue