test: set par=2 in default config for functional test framework #33485

pull andrewtoth wants to merge 1 commits into bitcoin:master from andrewtoth:par-test changing 1 files +1 −0
  1. andrewtoth commented at 4:09 pm on September 27, 2025: contributor
    Depending on the host machine, a default par value can spawn up to 15 script verification threads for each node. Running the functional test suite with default par can exhaust file descriptors or hit other resource limits when many threads are spawned. These threads are mostly idle and the same code paths are executed with a value of par=2. Limit this to 2 for functional tests that do not override the default option.
  2. DrahtBot added the label Tests on Sep 27, 2025
  3. DrahtBot commented at 4:09 pm on September 27, 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/33485.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK pablomartin4btc, l0rinc, maflcko, theStack

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

  4. in test/functional/test_framework/util.py:477 in 164a1fe956
    473@@ -474,6 +474,7 @@ def write_config(config_path, *, n, chain, extra_config="", disable_autoconnect=
    474         #  min_required_fds = MIN_CORE_FDS + MAX_ADDNODE_CONNECTIONS + nBind = 151 + 8 + 3 = 162;
    475         #  nMaxConnections = available_fds - min_required_fds = 256 - 161 = 94;
    476         f.write("maxconnections=94\n")
    477+        f.write("par=2\n")
    


    furszy commented at 7:12 pm on September 27, 2025:
    What about min(2, os.cpu_count()) to avoid forcing a second thread when only one core is available.

    andrewtoth commented at 7:16 pm on September 27, 2025:
    Is there a realistic case where only one core is available?

    furszy commented at 8:05 pm on September 27, 2025:
    Only the rpi zero comes to mind. It seems like a simple change anyway. I wouldn’t overthink it too much.

    l0rinc commented at 8:16 pm on September 27, 2025:
    Or maybe a dockerized container

    andrewtoth commented at 8:31 pm on September 27, 2025:
    Done!
  5. test: set par=2 in default config for functional test framework
    Depending on the host machine, a default `par` value can spawn up to 15 script verification threads for each node.
    Running the functional test suite with default `par` can exhaust file descriptors or hit other resource limits when many threads are spawned.
    These threads are mostly idle and the same code paths are executed with a value of `par=2`.
    Limit this to 2 for functional tests that do not override the default option.
    
    Co-authored-by: maflcko <6399679+maflcko@users.noreply.github.com>
    dda5228e02
  6. andrewtoth force-pushed on Sep 27, 2025
  7. pablomartin4btc commented at 9:08 pm on September 27, 2025: member

    ACK dda5228e02ca6a839bf87ae7dbd133547563816a

    I thought some of the top longest tests would require a diff (>) par=, but it looks alright.

  8. l0rinc approved
  9. l0rinc commented at 0:33 am on September 28, 2025: contributor
  10. andrewtoth commented at 12:40 pm on September 28, 2025: contributor

    Q: does this affect the “-par=1” cases

    No, extra args override args in the configuration file.

  11. maflcko commented at 6:30 am on September 29, 2025: member
    lgtm ACK dda5228e02ca6a839bf87ae7dbd133547563816a
  12. theStack approved
  13. theStack commented at 5:36 pm on September 29, 2025: contributor
    ACK dda5228e02ca6a839bf87ae7dbd133547563816a
  14. fanquake merged this on Oct 3, 2025
  15. fanquake closed this on Oct 3, 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-10-10 12:13 UTC

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