#36587 qa: Fix `interface_ipc*.py` on NetBSD and prevent future regressions
| Reviewability | Reviews | Agreement | Size | |||||||
|---|---|---|---|---|---|---|---|---|---|---|
| #36587 qa: Fix `interface_ipc*.py` on NetBSD and prevent future regressions | Ready | 0 | Blocked | 0 + 59 tests | ||||||
|
|
|
|
| ||||||
Reviewability: ReadyStalePaused Agreement: StrongPositivePositive w/ caveatsNeutralMildDisputedBlockedCrickets Reviews: current code-review ACKs, then (+stale ACKs) and -NACKs; greener = more ACKs. Size: lines added or modified outside tests, then in tests; greener = smaller. | ||||||||||
Goal
Fixes functional test failures in `interface_ipc*.py` on NetBSD by adjusting `-maxconnections` for nodes using IPC, and prevents future file descriptor budget regressions by adding an FD limit to the macOS CI task. Specifically, it lowers `-maxconnections` by 17 slots (one listening socket plus 16 client connections) when `-ipcbind` is enabled, and wraps node processes in the native macOS CI job with `ulimit -n 256` to mimic NetBSD's `FD_SETSIZE` constraint.
Problem: On select()-based platforms like NetBSD, the total available file descriptors cannot exceed `FD_SETSIZE` (256). When `-ipcbind` was introduced, its 17 reserved file descriptors pushed the test framework's node startup requirements over 256, causing `bitcoind` to warn about reducing `-maxconnections`, which the test framework treats as a fatal test failure. Because NetBSD only runs in nightly CI, such FD budget regressions recur and go undetected in per-PR CI runs.
Evidence of importance:
- PR description links to failures on NetBSD: "This PR fixes the `interface_ipc*.py` tests, which have been failing on NetBSD since https://github.com/bitcoin/bitcoin/pull/35037."
- Commit 62571e7e67 notes: "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."
- Author notes recurring regression pattern in PR description and commit 311bc7c3bb, citing prior fixes in PR #31537 and PR #36078 that were only caught post-merge by nightly NetBSD CI.
Risk of a mistake: low (tests). Changes are strictly confined to test framework configuration and CI shell scripts.
Reviewability
Ready
Nothing known that would invalidate a review now.
Waiting on (from the thread read):
- author: address loss of coverage for infinite file descriptors raised by Sjors 2026-10-28
- author: reply to maflcko's suggestion regarding pipefail and nounset 2026-10-28
Agreement
Blocked
objection that needs a change, nobody has replied (Sjors)
Thread notes: Sjors gave a Concept ACK while noting that wrap-fd-limit.sh loses test coverage for infinite file descriptors introduced by #34937, offering a diff to run feature_init.py uncapped as well. maflcko suggested setting pipefail and nounset in the wrapper script.
Objections, suggestions, and questions:
| Reviewer | Type | Harm, request, or question | Status | Must be | Author replied | Quote |
|---|---|---|---|---|---|---|
| Sjors (member) | objection, correctness | wrap-fd-limit.sh loses CI coverage for "infinite" file descriptors introduced by #34937 | open | changed | no | 2026-10-28: 'loses our coverage for "infinite" file descriptors introduced by #34937' |
| maflcko (member) | suggestion, safety | explicitly set pipefail and nounset in wrap-fd-limit.sh | open | answered | no | 2026-10-28: 'missing pipefail and nounset? I guess the script may fail anyway when nounset is hit, but can't hurt to be explicit here' |
Support:
- Sjors (member) (Concept ACK, 2026-10-28) [read: ci/test/wrap-fd-limit.sh, ci/test/03_test_script.sh]: (no reason given) [not substantive]
Participants:
- Sjors (member, objection, 1 statements 2026-10-28 to 2026-10-28): Concept ACK, but noted loss of test coverage for infinite file descriptors
- maflcko (member, neutral, 1 statements 2026-10-28 to 2026-10-28): suggested adding pipefail and nounset to wrap-fd-limit.sh
Files
73 lines under test/bench/ci.
- test/functional/test_framework/util.py +24/-14
- ci/test/wrap-fd-limit.sh +21/-0
- test/functional/test_framework/test_node.py +7/-0
- ci/test/03_test_script.sh +6/-0
- ci/test/00_setup_env_mac_native.sh +1/-0
Card
The short text the ranking pass compares across PRs.
This PR fixes `interface_ipc*.py` test failures on NetBSD and adds CI enforcement to prevent similar regressions before merging. When IPC is enabled, socket and client connection reservations push bitcoind beyond NetBSD's 256 FD limit when paired with the test suite's default connection count, producing startup warnings that fail the tests. The PR subtracts IPC reservations from `-maxconnections` on IPC-enabled nodes and adds an `RLIMIT_NOFILE` wrapper to the macOS CI job to enforce the 256 FD limit on standard PR checks.
Data
thread read through 2026-10-28 (3 statements), head 311bc7c3bb
labels: Tests
Categories
Build and CI
P3 · platform fix (ranking pass: Moved up from 38: fixes an actual platform test failure on NetBSD plus CI enforcement, stronger than nearby hygiene items)
The change adds file descriptor limit wrapping to macOS CI to catch NetBSD-specific FD limit regressions in per-PR runs instead of waiting for nightly CI. This improves CI test coverage for a recurring failure mode across platforms, though it does not address core build or release integrity.
Membership: Adds `ci/test/wrap-fd-limit.sh` and updates CI test scripts to enforce an FD budget in the macOS native CI job.
Factors: security/stability 0, bug 1, performance 0, user value 0, leverage 0
Test infrastructure
P2 · bug fix (assessed alone as P3; Raised to P2 for consistency with #36408: both fix recurring real test failures, and this one also adds CI enforcement so the FD-budget regression is caught per-PR.)
The PR fixes a recurring functional test failure in `interface_ipc*.py` on NetBSD caused by `-ipcbind` file descriptors exceeding the `FD_SETSIZE` (256) limit. This restores passing test signal on NetBSD nightly runs by adjusting framework max connection limits.
Membership: Labeled 'Tests' and changes test framework node startup logic in `test/functional/test_framework/util.py` and `test_framework/test_node.py`.
Factors: security/stability 0, bug 1, performance 0, user value 0, leverage 0