diff options
author | Martin Zumsande <mzumsande@gmail.com> | 2023-07-19 14:14:46 -0400 |
---|---|---|
committer | Martin Zumsande <mzumsande@gmail.com> | 2023-07-19 14:14:59 -0400 |
commit | e667bd68a10512ddc784df44bdcb63ee441e5551 (patch) | |
tree | 92be595b95ac1c4875bc75911b898bb080dbb7a2 /test | |
parent | 78a983f597af224e017f522443112cec81422fe6 (diff) | |
download | bitcoin-e667bd68a10512ddc784df44bdcb63ee441e5551.tar.xz |
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.
Diffstat (limited to 'test')
-rwxr-xr-x | test/functional/wallet_resendwallettransactions.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/test/functional/wallet_resendwallettransactions.py b/test/functional/wallet_resendwallettransactions.py index 7bdb6f5e3a..f36d8efda7 100755 --- a/test/functional/wallet_resendwallettransactions.py +++ b/test/functional/wallet_resendwallettransactions.py @@ -108,9 +108,13 @@ class ResendWalletTransactionsTest(BitcoinTestFramework): # 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) |