test: test_inv_block, use mocktime instead of waiting #31811

pull instagibbs wants to merge 1 commits into bitcoin:master from instagibbs:2025-02-tx_dl_mocktime changing 1 files +6 −1
  1. instagibbs commented at 4:37 pm on February 6, 2025: member

    Performance issue reported in #31437 (comment)

    It seems that code as-is waits for wall-clock time to pass to synchronize mempools. Locally, sometimes the subtest takes a couple seconds, sometimes it takes an additional minute.

    Just use mocktime?

  2. test: test_inv_block, use mocktime instead of waiting 2706c5b7c8
  3. DrahtBot commented at 4:37 pm on February 6, 2025: contributor

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

    Code Coverage & Benchmarks

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

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK sr-gi, Prabhat1308, rishkwal

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  4. DrahtBot added the label Tests on Feb 6, 2025
  5. sr-gi commented at 6:54 pm on February 6, 2025: member

    tACK 2706c5b

    Run the test several times and it seems to be consistent around ~30s now, whereas it previously fluctuated between ~30-90s

  6. Prabhat1308 commented at 8:07 pm on February 6, 2025: contributor

    tACK 2706c5b

    Speedup is observed when running the test with the diffs.

    ACK with the use of Mocktime as the test is independent from the use of wall-clock time. This can be seen by the use of setmocktime() in other functions in the same file as well .

  7. stark-3k commented at 11:11 am on February 7, 2025: none

    tACK 2706c5b

    Tested multiple times. Previously took anywhere between 36 to 96 seconds. Now consistently taking around 35 to 37 seconds. Agree that test_inv_block does not need real-time delay.

  8. glozow merged this on Feb 7, 2025
  9. glozow closed this on Feb 7, 2025

  10. sedited referenced this in commit f78a01a560 on Feb 22, 2025
  11. stickies-v referenced this in commit d760fd3dda on Mar 17, 2025
  12. stickies-v referenced this in commit cc83553352 on Mar 17, 2025
  13. stickies-v referenced this in commit 2614933f06 on Mar 17, 2025
  14. stickies-v referenced this in commit b70418c5fc on Mar 17, 2025
  15. stickies-v referenced this in commit 69f8a1fe50 on Mar 17, 2025
  16. bug-castercv502 referenced this in commit d15545ffaa on Sep 28, 2025
  17. knst referenced this in commit b33ef3b8be on Oct 22, 2025
  18. bitcoin locked this on Feb 7, 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-03-28 00:13 UTC

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