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: none

    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. rishkwal 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


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: 2025-02-22 06:12 UTC

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