Repository navigation
test: opt flaky functional tests into immediate tx relay - #36306
ronnakamoto wants to merge 1 commit into
Conversation
Functional tests are intrinsically vulnerable to timeouts because transaction relay to inbound peers is delayed by a Poisson process (bitcoin#19732). Tests that do not specifically exercise relay timing can therefore fail intermittently when they wait on transactions still inside the relay-delay window. Opt the affected tests into immediate transaction relay by setting the noban_tx_relay attribute, which whitelists the local peer (-whitelist=noban,in,[email protected]) and bypasses the delayed relay: - mempool_accept_wtxid - mempool_limit - mempool_package_rbf - mempool_persist - wallet_change_address - wallet_conflicts - wallet_orphanedreward Also preserve the immediate-relay whitelist across node restarts that pass a literal argument list (-disablewallet, -persistmempool=0), which previously dropped the whitelist and reintroduced the relay delay: - mempool_persist - wallet_balance - rpc_psbt
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code Coverage & BenchmarksFor details see: https://corecheck.dev/bitcoin/bitcoin/pulls/36306. ReviewsSee the guideline and AI policy for information on the review process. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
|
To preserve the time of reviewers, this project requires authors to understand the code they are submitting. Given that the description looks entirely LLM generated, I don't think that is the case, so I am closing this again. |
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,[email protected]) and bypasses the delayed relay:
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:
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:
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.