tests: speed up coins_tests by parallelizing #32945

pull ajtowns wants to merge 1 commits into bitcoin:master from ajtowns:202507-par-coins-tests changing 3 files +21 −11
  1. ajtowns commented at 8:41 am on July 11, 2025: contributor
    Updates the cmake logic to generate a separate test for each BOOST_FIXTURE_TEST_SUITE declaration in a file, and splits coins_tests.cpp into three separate suites so that they can be run in parallel. Also updates the convention enforced by test/lint/lint-tests.py.
  2. DrahtBot added the label Tests on Jul 11, 2025
  3. DrahtBot commented at 8:41 am on July 11, 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/32945.

    Reviews

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

  4. ajtowns commented at 8:44 am on July 11, 2025: contributor

    For me, coins_tests it’s a pretty significant bottleneck to running tests. With this patch and -j20 I go from:

    0137/139 Test  [#26](/bitcoin-bitcoin/26/): checkqueue_tests .....................   Passed   50.37 sec
    1138/139 Test [#126](/bitcoin-bitcoin/126/): coinselector_tests ...................   Passed   52.53 sec
    2139/139 Test  [#28](/bitcoin-bitcoin/28/): coins_tests ..........................   Passed  137.43 sec
    3
    4100% tests passed, 0 tests failed out of 139
    5
    6Total Test time (real) = 137.43 sec
    

    to

    0 69/141 Test  [#30](/bitcoin-bitcoin/30/): coins_tests ..........................   Passed   24.46 sec
    1...
    2138/141 Test [#128](/bitcoin-bitcoin/128/): coinselector_tests ...................   Passed   50.16 sec
    3139/141 Test  [#28](/bitcoin-bitcoin/28/): coins_base_tests .....................   Passed   53.28 sec
    4140/141 Test  [#26](/bitcoin-bitcoin/26/): checkqueue_tests .....................   Passed   54.31 sec
    5141/141 Test  [#29](/bitcoin-bitcoin/29/): coins_dbbase_tests ...................   Passed   63.89 sec
    6
    7100% tests passed, 0 tests failed out of 141
    8
    9Total Test time (real) =  63.89 sec
    

    ie, less than half the time. (The bench_sanity test is also pretty slow though, if benchmarking is enabled)

  5. ajtowns force-pushed on Jul 11, 2025
  6. DrahtBot added the label CI failed on Jul 11, 2025
  7. DrahtBot commented at 8:55 am on July 11, 2025: contributor

    🚧 At least one of the CI tasks failed. Task lint: https://github.com/bitcoin/bitcoin/runs/45784666394 LLM reason (✨ experimental): The CI failure is caused by errors in the linting step.

    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.

  8. tests: speed up coins_tests by parallelizing
    Updates the cmake logic to generate a separate test for each
    BOOST_FIXTURE_TEST_SUITE declaration in a file, and splits coins_tests.cpp
    into three separate suites so that they can be run in parallel. Also
    updates the convention enforced by test/lint/lint-tests.py.
    68fd1f1b96
  9. ajtowns force-pushed on Jul 11, 2025
  10. TheCharlatan commented at 9:04 pm on July 11, 2025: contributor
    Are you running this on an older machine, or are missing some of the crypto accelerator features? Your reported runtimes are about an order of magnitude longer than mine and even our CI machines report the tests running much faster.
  11. ajtowns commented at 9:31 pm on July 11, 2025: contributor

    Are you running this on an older machine, or are missing some of the crypto accelerator features? Your reported runtimes are about an order of magnitude longer than mine and even our CI machines report the tests running much faster.

    Hmm, it’s a bit old I guess; 2019-era high-end desktop cpu, and running in a vm under qemu. It’s also a debug build, with the extra checks that implies.

    CI failures seem to indicate my cmake code doesn’t work with something other than ninja as the test conductor?


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-07-12 09:13 UTC

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