Skip to content

Commit fac2fc4

Browse files
author
MarcoFalke
committed
test: Increase debugging to hunt down mempool_reorg intermittent failure
1 parent b470c75 commit fac2fc4

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

test/functional/mempool_reorg.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ def set_test_params(self):
2020
def skip_test_if_missing_module(self):
2121
self.skip_if_no_wallet()
2222

23-
alert_filename = None # Set by setup_network
24-
2523
def run_test(self):
2624
# Start with a 200 block chain
2725
assert_equal(self.nodes[0].getblockcount(), 200)
@@ -76,9 +74,8 @@ def run_test(self):
7674
spend_101_id = self.nodes[0].sendrawtransaction(spend_101_raw)
7775
spend_102_1_id = self.nodes[0].sendrawtransaction(spend_102_1_raw)
7876

79-
self.sync_all(timeout=720)
80-
8177
assert_equal(set(self.nodes[0].getrawmempool()), {spend_101_id, spend_102_1_id, timelock_tx_id})
78+
self.sync_all()
8279

8380
for node in self.nodes:
8481
node.invalidateblock(last_block[0])
@@ -91,10 +88,9 @@ def run_test(self):
9188
for node in self.nodes:
9289
node.invalidateblock(new_blocks[0])
9390

94-
self.sync_all(timeout=720)
95-
9691
# mempool should be empty.
9792
assert_equal(set(self.nodes[0].getrawmempool()), set())
93+
self.sync_all()
9894

9995

10096
if __name__ == '__main__':

test/functional/test_framework/util.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,10 @@ def sync_blocks(rpc_connections, *, wait=1, timeout=60):
410410
# Check that each peer has at least one connection
411411
assert (all([len(x.getpeerinfo()) for x in rpc_connections]))
412412
time.sleep(wait)
413-
raise AssertionError("Block sync timed out:{}".format("".join("\n {!r}".format(b) for b in best_hash)))
413+
raise AssertionError("Block sync timed out after {}s:{}".format(
414+
timeout,
415+
"".join("\n {!r}".format(b) for b in best_hash),
416+
))
414417

415418

416419
def sync_mempools(rpc_connections, *, wait=1, timeout=60, flush_scheduler=True):
@@ -429,11 +432,16 @@ def sync_mempools(rpc_connections, *, wait=1, timeout=60, flush_scheduler=True):
429432
# Check that each peer has at least one connection
430433
assert (all([len(x.getpeerinfo()) for x in rpc_connections]))
431434
time.sleep(wait)
432-
raise AssertionError("Mempool sync timed out:{}".format("".join("\n {!r}".format(m) for m in pool)))
435+
raise AssertionError("Mempool sync timed out after {}s:{}".format(
436+
timeout,
437+
"".join("\n {!r}".format(m) for m in pool),
438+
))
439+
433440

434441
# Transaction/Block functions
435442
#############################
436443

444+
437445
def find_output(node, txid, amount, *, blockhash=None):
438446
"""
439447
Return index to output of txid with value amount

0 commit comments

Comments
 (0)