Skip to content

Commit e667bd6

Browse files
committed
test: fix intermittent failure in wallet_resendwallettransactions.py
Before, it was possible that a resend was triggered right between eviction the txns from the mempool and the check that they were evicted.
1 parent 78a983f commit e667bd6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

test/functional/wallet_resendwallettransactions.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,13 @@ def run_test(self):
108108
# Set correct m_best_block_time, which is used in ResubmitWalletTransactions
109109
node.syncwithvalidationinterfacequeue()
110110

111-
# Evict these txs from the mempool
112111
evict_time = block_time + 60 * 60 * DEFAULT_MEMPOOL_EXPIRY_HOURS + 5
113-
node.setmocktime(evict_time)
112+
# Flush out currently scheduled resubmit attempt now so that there can't be one right between eviction and check.
113+
with node.assert_debug_log(['resubmit 2 unconfirmed transactions']):
114+
node.setmocktime(evict_time)
115+
node.mockscheduler(60)
116+
117+
# Evict these txs from the mempool
114118
indep_send = node.send(outputs=[{node.getnewaddress(): 1}], inputs=[indep_utxo])
115119
node.getmempoolentry(indep_send["txid"])
116120
assert_raises_rpc_error(-5, "Transaction not in mempool", node.getmempoolentry, txid)

0 commit comments

Comments
 (0)