diff --git a/test/functional/mempool_persist.py b/test/functional/mempool_persist.py --- a/test/functional/mempool_persist.py +++ b/test/functional/mempool_persist.py @@ -77,16 +77,19 @@ "Verify that node2 calculates its balance correctly " "after loading wallet transactions.") self.stop_nodes() - self.start_node(0) + # Give this one a head-start, so we can be "extra-sure" that it didn't load anything later self.start_node(1) + self.start_node(0) self.start_node(2) # Give bitcoind a second to reload the mempool - time.sleep(1) - wait_until(lambda: len(self.nodes[0].getrawmempool()) == 5) - wait_until(lambda: len(self.nodes[2].getrawmempool()) == 5) + wait_until(lambda: len(self.nodes[0].getrawmempool()) == 5, timeout=1) + wait_until(lambda: len(self.nodes[2].getrawmempool()) == 5, timeout=1) + # The others have loaded their mempool. If node_1 loaded anything, we'd probably notice by now: assert_equal(len(self.nodes[1].getrawmempool()), 0) # Verify accounting of mempool transactions after restart is correct + # Flush mempool to wallet + self.nodes[2].syncwithvalidationinterfacequeue() assert_equal(node2_balance, self.nodes[2].getbalance()) self.log.debug( diff --git a/test/functional/wallet_zapwallettxes.py b/test/functional/wallet_zapwallettxes.py --- a/test/functional/wallet_zapwallettxes.py +++ b/test/functional/wallet_zapwallettxes.py @@ -61,6 +61,8 @@ wait_until(lambda: self.nodes[0].getmempoolinfo()[ 'size'] == 1, timeout=3) + # Flush mempool to wallet + self.nodes[0].syncwithvalidationinterfacequeue() assert_equal(self.nodes[0].gettransaction(txid1)['txid'], txid1) assert_equal(self.nodes[0].gettransaction(txid2)['txid'], txid2)