qa: Fix `interface_ipc*.py` on NetBSD and prevent future regressions #36587

pull hebasto wants to merge 3 commits into bitcoin:master from hebasto:261021-macos-netbsd changing 5 files +59 −14
  1. hebasto commented at 7:32 AM on October 21, 2026: member

    This PR fixes the interface_ipc*.py tests, which have been failing on NetBSD since #35037.

    As file descriptor budget regressions of this kind recur (see #31537 and #36078), the macOS CI job now models NetBSD's limit so they are caught before merging rather than by nightly NetBSD CI afterwards.

    See the commit messages for details.

  2. qa, refactor: Move `-maxconnections` budget into named constant
    Easy to review using the following:
    ```
    git diff --color-moved=dimmed-zebra --color-moved-ws=allow-indentation-change
    ```
    956f807bdb
  3. qa: Account for `-ipcbind` file descriptors in `-maxconnections`
    Since `-ipcbind` reserves one listening socket plus
    `ipc::DEFAULT_MAX_CONNECTIONS` (16) client slots in `min_required_fds`,
    the framework's `-maxconnections=76` no longer fits the 256 file
    descriptor budget on NetBSD, and every `interface_ipc*.py` node starts
    with "Warning: Reducing -maxconnections ...", which the framework treats
    as a failure.
    
    Lower `-maxconnections` by that reservation on IPC-enabled nodes only,
    so the rest of the suite keeps its P2P connection slots.
    62571e7e67
  4. ci: Enforce NetBSD's 256 file descriptor budget in the macOS job
    On select()-based platforms such as NetBSD, `bitcoind` can use at most
    `FD_SETSIZE` (256) file descriptors, so the functional test framework
    pins `-maxconnections` to that budget. Any change that grows
    `min_required_fds` then makes every node print "Warning: Reducing
    -maxconnections ...", which the framework treats as a failure. Such
    regressions are currently caught only by nightly NetBSD CI (see #31537,
    
    Add a `CI_LIMIT_FD_COUNT` knob that runs functional test node processes
    through a wrapper capping `RLIMIT_NOFILE`, and enable it for the macOS
    native job with NetBSD's value of 256.
    311bc7c3bb
  5. DrahtBot added the label Tests on Oct 21, 2026
  6. DrahtBot commented at 7:32 AM on October 21, 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.

    Type Reviewers
    Concept ACK Sjors
    Approach NACK fanquake

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #31349 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/31349.svg"></sub> (ci: detect outbound internet traffic generated while running tests by vasild)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  7. hebasto renamed this:
    qa: Fix `interface_ipc*.py` on NetBSD and prevent r
    qa: Fix `interface_ipc*.py` on NetBSD and prevent future regressions
    on Oct 21, 2026
  8. hebasto closed this on Oct 21, 2026

  9. hebasto reopened this on Oct 21, 2026

  10. DrahtBot added the label CI failed on Oct 21, 2026
  11. hebasto commented at 7:42 AM on October 21, 2026: member
  12. DrahtBot removed the label CI failed on Oct 21, 2026
  13. hebasto referenced this in commit ae16bf6548 on Oct 22, 2026
  14. hebasto referenced this in commit 0d6d4d5050 on Oct 23, 2026
  15. Sjors commented at 4:26 AM on October 28, 2026: member

    Concept ACK

    But wrap-fd-limit.sh‎ in 311bc7c3bb274c7065f871198fa0910c205b8a6a loses our coverage for "infinite" file descriptors introduced by #34937.

    We could run feature_init.py both capped and uncapped:

    diff --git a/ci/test/03_test_script.sh b/ci/test/03_test_script.sh
    index d5981147f4..1468638690 100755
    --- a/ci/test/03_test_script.sh
    +++ b/ci/test/03_test_script.sh
    @@ -161,5 +161,6 @@ if [ -n "${CI_LIMIT_FD_COUNT}" ]; then
       # Only the node processes are capped (via BITCOIN_CMD), not the Python
       # test runner, which needs more descriptors when running jobs in parallel.
    -  export BITCOIN_CMD="${BASE_ROOT_DIR}/ci/test/wrap-fd-limit.sh ${BITCOIN_CMD:-bitcoin}"
    +  BITCOIN_CMD_UNCAPPED="${BITCOIN_CMD:-bitcoin}"
    +  export BITCOIN_CMD="${BASE_ROOT_DIR}/ci/test/wrap-fd-limit.sh ${BITCOIN_CMD_UNCAPPED}"
     fi
     
    @@ -208,4 +209,20 @@ if [ "$RUN_FUNCTIONAL_TESTS" = "true" ]; then
         --quiet \
         --failfast
    +
    +  if [ -n "${CI_LIMIT_FD_COUNT}" ]; then
    +    # The capped suite also runs feature_init.py, but the wrapper overrides the
    +    # RLIM_INFINITY and above-INT_MAX limits it tests. Repeat it without the cap.
    +    BITCOIN_CMD="${BITCOIN_CMD_UNCAPPED}" \
    +    LD_LIBRARY_PATH="${DEPENDS_DIR}/${HOST}/lib" \
    +    "${BASE_BUILD_DIR}/test/functional/test_runner.py" \
    +      "${MAKEJOBS}" \
    +      --tmpdirprefix "${BASE_SCRATCH_DIR}/test_runner_uncapped/" \
    +      --ansi \
    +      --combinedlogslen=99999999 \
    +      --timeout-factor="${TEST_RUNNER_TIMEOUT_FACTOR}" \
    +      --quiet \
    +      --failfast \
    +      feature_init.py
    +  fi
     fi
    

    Alternatively we could drop that test.

  16. in ci/test/wrap-fd-limit.sh:17 in 311bc7c3bb
      12 | +# platform, so an fd-budget regression (e.g. a new "Reducing -maxconnections ..."
      13 | +# warning on stderr, which the functional test framework treats as a failure) is
      14 | +# caught by this job instead of only on NetBSD.
      15 | +
      16 | +export LC_ALL=C.UTF-8
      17 | +set -o errexit
    


    maflcko commented at 6:08 AM on October 28, 2026:

    missing pipefail and nounset? I guess the script may fail anyway when nounset is hit, but can't hurt to be explicit here

  17. fanquake commented at 10:32 AM on November 16, 2026: member

    the macOS CI job now models NetBSD's limit so they are caught before merging

    Approach NACK. Rather than hijacking tests we already have, to emulate the constraints of other operating systems, we should add proper tests for things we are claiming/trying to support i.e #36147.

  18. hebasto commented at 5:18 PM on November 16, 2026: member

    the macOS CI job now models NetBSD's limit so they are caught before merging

    Approach NACK. Rather than hijacking tests we already have, to emulate the constraints of other operating systems, we should add proper tests for things we are claiming/trying to support i.e #36147.

    I would agree with this in an ideal world. However, a native NetBSD CI job seems to be a hard goal for this project.

  19. fanquake commented at 10:17 AM on November 17, 2026: member

    However, a native NetBSD CI job #36147 (comment) to be a hard goal for this project.

    NetBSD’s infrastructure is the least reliable of the three, compared with FreeBSD’s and OpenBSD’s. A significant share of NetBSD nightly jobs fail because of package installation failures.

    Shouldn't that problem be solved at a different layer? If the problem is infrastructure, introduce more caching, or prebuilt/reusable container images, rather than trying to push complexity into unrelated tests.

  20. hebasto commented at 10:38 AM on November 17, 2026: member

    the macOS CI job now models NetBSD's limit so they are caught before merging

    Approach NACK. Rather than hijacking tests we already have, to emulate the constraints of other operating systems, we should add proper tests for things we are claiming/trying to support i.e #36147.

    Would dropping the last commit from this PR change your mind?

  21. maflcko commented at 11:38 AM on November 17, 2026: member

    It seems plausible that a user is running the tests with a fd limit on any select based OS. If we want to support that, it seems fine to add it to the CI. Using any CI config for that seems fine, given that such a user may be on any of those OS's.

  22. fanquake commented at 12:01 PM on November 17, 2026: member

    running the tests with a fd limit on any select based OS. If we want to support that,

    It's not clear we do (#36761). We may move away from select() on macOS (and all other OS's), so I don't think adding new test coverage for select on NetBSD, via macOS is a great approach. It seems like it would be more productive to work on switching NetBSD to poll()?

    If we do still want to do this, it seems like it should be in it's own, isolated test, which will not interfere with any poll() migration, so we can avoid any concerns about "losing coverage", if macOS was migrated away from select().


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-12-05 03:51 UTC

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