Part of #19732.
Functional tests are intrinsically vulnerable to timeouts because transaction relay to inbound peers is delayed by a Poisson process. Tests that do not specifically exercise relay timing can therefore fail intermittently when they wait on transactions still inside the relay-delay window.
This PR opts the affected tests into immediate transaction relay by setting noban_tx_relay = True, which whitelists the local peer (-whitelist=noban,in,out@127.0.0.1) and bypasses the delayed relay:
- mempool_accept_wtxid
- mempool_limit
- mempool_package_rbf
- mempool_persist
- wallet_change_address
- wallet_conflicts
- wallet_orphanedreward
Three tests also restart a node with a literal argument list (-disablewallet, -persistmempool=0), which silently dropped the whitelist and reintroduced the relay delay. Their restarts now inherit self.extra_args[i] so the immediate-relay whitelist survives:
- mempool_persist
- wallet_balance
- rpc_psbt
Together this covers 8 of the 14 tests on the current flaky list in #19732, every non-timing test on it. wallet_balance and rpc_psbt already carried their opt-in but were still failing for the restart reason above; wallet_orphanedreward is not on the list but is subject to the same failure mode.
The remaining 6 tests on the list deliberately exercise relay timing and cannot opt into immediate relay; per the discussion in #19732 they need mocktime or a larger base timeout instead:
- mempool_reorg
- p2p_blocksonly
- p2p_leak_tx
- p2p_private_broadcast
- p2p_tx_download
- p2p_tx_privacy
Note that a timeout signature is not a reliable discriminator here, several of this fail with the same ~60 s timeout as the fixable ones, because their mocktime advance is calibrated to the real relay mean. The discriminator is what each test asserts. p2p_tx_privacy currently has no mocktime calls at all, so it needs mocktime added rather than adjusted.
Testing
All nine changed tests pass under the #19732 reproducer (forcing a 12-minute relay delay in NextInvToInbounds): e.g. wallet_change_address 62 s to 3 s, wallet_balance 66 s to 6 s, rpc_psbt 74 s to 14 s. The unchanged tests are unaffected.