Skip to content

Commit b3022af

Browse files
committed
Merge bitcoin#28108: test: fix intermittent failure in wallet_resendwallettransactions.py
e667bd6 test: fix intermittent failure in wallet_resendwallettransactions.py (Martin Zumsande) Pull request description: Fixes bitcoin#28094 The test bumps the mocktime for ~2 weeks and then triggers eviction from the mempool. But this bump will also cause a new resubmit, and if the timing is such that this resubmit happens right after the eviction and before the check that the tx was evicted, the test can fail as in bitcoin#28094: ``` node0 2023-07-17T21:31:23.809483Z (mocktime: 2023-08-02T09:46:27Z) [httpworker.1] [validation.cpp:267] [LimitMempoolSize] [mempool] Expired 2 transactions from the memory pool node0 2023-07-17T21:31:23.810079Z (mocktime: 2023-08-02T09:46:27Z) [scheduler] [wallet/wallet.h:895] [WalletLogPrintf] [default wallet] ResubmitWalletTransactions: resubmit 2 unconfirmed transactions node0 2023-07-17T21:31:23.810474Z (mocktime: 2023-08-02T09:46:27Z) [httpworker.2] [rpc/request.cpp:181] [parse] [rpc] ThreadRPCServer method=getmempoolentry user=__cookie__ 2023-07-17T21:31:23.811000Z TestFramework (ERROR): Assertion failed (...) AssertionError: No exception raised ``` Fix this by flushing out the current resubmit call before triggering mempool eviction. ACKs for top commit: MarcoFalke: Nice. lgtm ACK e667bd6 achow101: ACK e667bd6 jonatack: Light "this looks like the other tests in this file" ACK e667bd6 Tree-SHA512: 027c2177ecd8bea80ec388ec2564f8fcbc717efd2722304b16fc0e9fa7ad216af61977c4e360b8135de68586cf13b0aa729ffa4fa27bad655092c3a55f73933c
2 parents 7edce77 + e667bd6 commit b3022af

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)