test: opt flaky functional tests into immediate tx relay #36306

pull ronnakamoto wants to merge 1 commits into bitcoin:master from ronnakamoto:test/noban-tx-relay changing 9 files +16 −3
  1. ronnakamoto commented at 5:11 AM on September 21, 2026: none

    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.

  2. test: opt flaky functional tests into immediate tx relay
    Functional tests are intrinsically vulnerable to timeouts because
    transaction relay to inbound peers is delayed by a Poisson process
    (#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,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
    
    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
    c816b20759
  3. DrahtBot added the label Tests on Sep 21, 2026
  4. DrahtBot commented at 5:11 AM on September 21, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/36306.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process. A summary of reviews will appear here.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #36440 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36440.svg"></sub> (test: speed up functional tests by removing avoidable waits by ViniciusCestarii)

    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.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  5. sedited commented at 2:27 PM on October 8, 2026: contributor

    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.

  6. sedited closed this on Oct 8, 2026


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-10-18 13:51 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me