Skip to content

Commit

Permalink
test: fix intermittent failure in wallet_resendwallettransactions.py
Browse files Browse the repository at this point in the history
Before, it was possible that a resend was triggered right between
eviction the txns from the mempool and the check that they were evicted.
  • Loading branch information
mzumsande committed Jul 19, 2023
1 parent 78a983f commit e667bd6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/functional/wallet_resendwallettransactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,13 @@ def run_test(self):
# Set correct m_best_block_time, which is used in ResubmitWalletTransactions
node.syncwithvalidationinterfacequeue()

# Evict these txs from the mempool
evict_time = block_time + 60 * 60 * DEFAULT_MEMPOOL_EXPIRY_HOURS + 5
node.setmocktime(evict_time)
# Flush out currently scheduled resubmit attempt now so that there can't be one right between eviction and check.
with node.assert_debug_log(['resubmit 2 unconfirmed transactions']):
node.setmocktime(evict_time)
node.mockscheduler(60)

# Evict these txs from the mempool
indep_send = node.send(outputs=[{node.getnewaddress(): 1}], inputs=[indep_utxo])
node.getmempoolentry(indep_send["txid"])
assert_raises_rpc_error(-5, "Transaction not in mempool", node.getmempoolentry, txid)
Expand Down

0 comments on commit e667bd6

Please sign in to comment.