Skip to content

Commit 1213be6

Browse files
committed
Merge #12217: qa: Add missing syncwithvalidationinterfacequeue to tests
fa796bb qa: Add missing syncwithvalidationinterfacequeue to tests (MarcoFalke) Pull request description: Fixes intermittent travis failures with those tests caused by a missing flush of mempool txes to the wallet. Tree-SHA512: 4f57c93a81af9c07b36c16996bf3e6bbb2af61779f0d6ae0126b64563eb4ec4b53f64241c9cf4c3f322db56f4339fd939319747653bebc93bbc7e3d5dceedda6
2 parents 9cf6393 + fa796bb commit 1213be6

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

test/functional/mempool_persist.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,17 @@ def run_test(self):
6666

6767
self.log.debug("Stop-start the nodes. Verify that node0 has the transactions in its mempool and node1 does not. Verify that node2 calculates its balance correctly after loading wallet transactions.")
6868
self.stop_nodes()
69+
self.start_node(1) # Give this one a head-start, so we can be "extra-sure" that it didn't load anything later
6970
self.start_node(0)
70-
self.start_node(1)
7171
self.start_node(2)
7272
# Give bitcoind a second to reload the mempool
73-
time.sleep(1)
74-
wait_until(lambda: len(self.nodes[0].getrawmempool()) == 5)
75-
wait_until(lambda: len(self.nodes[2].getrawmempool()) == 5)
73+
wait_until(lambda: len(self.nodes[0].getrawmempool()) == 5, timeout=1)
74+
wait_until(lambda: len(self.nodes[2].getrawmempool()) == 5, timeout=1)
75+
# The others have loaded their mempool. If node_1 loaded anything, we'd probably notice by now:
7676
assert_equal(len(self.nodes[1].getrawmempool()), 0)
7777

7878
# Verify accounting of mempool transactions after restart is correct
79+
self.nodes[2].syncwithvalidationinterfacequeue() # Flush mempool to wallet
7980
assert_equal(node2_balance, self.nodes[2].getbalance())
8081

8182
self.log.debug("Stop-start node0 with -persistmempool=0. Verify that it doesn't load its mempool.dat file.")

test/functional/wallet_zapwallettxes.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ def run_test(self):
5959
self.start_node(0, ["-persistmempool=1", "-zapwallettxes=2"])
6060

6161
wait_until(lambda: self.nodes[0].getmempoolinfo()['size'] == 1, timeout=3)
62+
self.nodes[0].syncwithvalidationinterfacequeue() # Flush mempool to wallet
6263

6364
assert_equal(self.nodes[0].gettransaction(txid1)['txid'], txid1)
6465
assert_equal(self.nodes[0].gettransaction(txid2)['txid'], txid2)

0 commit comments

Comments
 (0)