test: use mocktime in p2p_tx_privacy.py #36987

pull Waridi318 wants to merge 1 commits into bitcoin:master from Waridi318:19732-tx-privacy-mocktime changing 1 files +7 −0
  1. Waridi318 commented at 10:11 AM on November 26, 2026: contributor

    p2p_tx_privacy.py waits 60 seconds for tx2's announcement but the node holds announcements behind a random delay that has no upper bound. An unlucky draw fails the test even though the node behaved as expected and a larger timeout lowers that chance without reaching zero.

    This freezes the node's clock before the peers connect and advances it once tx2 is queued thus releasing the queued announcement. One file from #19732.

    Verification

    Against master at 3e4c803da8, with the reproduction patch from the issue that fixes the NextInvToInbounds draw at 12 minutes:

    • master, patched: fails at 60 s in wait_for_inv_match
    • this branch, patched: passes in 1 s
    • this branch, unpatched: passes, 40 consecutive runs
    • this branch with the guard at net_processing.cpp:2464 removed: fails and the spy receives an inv for tx1's wtxid, so the coverage added in #26569 is intact
  2. test: use mocktime in p2p_tx_privacy.py
    The test waits 60 seconds for tx2's announcement yet the node holds it
    behind a random delay with no upper bound. An unlucky draw fails the
    test even when the node behaved as expected. Raising the timeout lowers
    that chance without removing it.
    
    Freeze the node's clock before peers connect then advance it once tx2 is
    queued thus releasing the announcement instead of waiting for it. The
    delay itself and the single announcement assertion are unchanged.
    73435c8c88
  3. DrahtBot added the label Tests on Nov 26, 2026
  4. DrahtBot commented at 10:11 AM on November 26, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    External sites

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

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

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  5. DrahtBot added the label CI failed on Nov 26, 2026
  6. DrahtBot commented at 10:54 AM on November 26, 2026: contributor

    <!--85328a0da195eb286784d51f73fa0af9-->

    🚧 At least one of the CI tasks failed. <sub>Task lint: https://github.com/bitcoin/bitcoin/actions/runs/45799043848/job/139837120806</sub> <sub>LLM reason (✨ experimental): CI failed lint checks because test/functional/p2p_tx_privacy.py:73 contains trailing whitespace, flagged by both Ruff and the trailing-whitespace check.</sub>

    <details><summary>Hints</summary>

    Try to run the tests locally, according to the documentation. However, a CI failure may still happen due to a number of reasons, for example:

    • Possibly due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch.

    • A sanitizer issue, which can only be found by compiling with the sanitizer and running the affected test.

    • An intermittent issue.

    Leave a comment here, if you need help tracking down a confusing failure.

    </details>

  7. DrahtBot removed the label CI failed on Nov 27, 2026
  8. DrahtBot added the label CI failed on Nov 27, 2026
  9. DrahtBot commented at 2:30 PM on November 27, 2026: contributor

    <!--85328a0da195eb286784d51f73fa0af9-->

    🚧 At least one of the CI tasks failed. <sub>Task lint: https://github.com/bitcoin/bitcoin/actions/runs/45799043848/job/140564509994</sub> <sub>LLM reason (✨ experimental): lint_fail: Ruff and the trailing-whitespace check failed on whitespace at line 73 of test/functional/p2p_tx_privacy.py.</sub>

    <details><summary>Hints</summary>

    Try to run the tests locally, according to the documentation. However, a CI failure may still happen due to a number of reasons, for example:

    • Possibly due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch.

    • A sanitizer issue, which can only be found by compiling with the sanitizer and running the affected test.

    • Intermittent network issues can occur; re-run CI for now, and report the issue if they keep happening.

    • A functional or integration test failure may be intermittent or unrelated to this pull request. If no dedicated issue thread exists, create a new one to track it.

    Leave a comment here, if you need help tracking down a confusing failure.

    </details>


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-11-28 06:51 UTC

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