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

    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.

    <!--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


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-10-30 09:40 UTC