{
 "number": 36587,
 "repo": "bitcoin/bitcoin",
 "url": "https://github.com/bitcoin/bitcoin/pull/36587",
 "title": "qa: Fix `interface_ipc*.py` on NetBSD and prevent future regressions",
 "author": "hebasto",
 "author_association": "MEMBER",
 "created_at": "2026-10-21T07:32:06Z",
 "updated_at": "2026-10-28T06:08:36Z",
 "description_hash": "c3aa1294e70677f7",
 "age_days": 11,
 "draft": false,
 "labels": [
  "Tests"
 ],
 "milestone": null,
 "base": "master",
 "head_sha": "311bc7c3bb274c7065f871198fa0910c205b8a6a",
 "head_ref": "261021-macos-netbsd",
 "head_repo": "hebasto/bitcoin",
 "head_history": [],
 "additions": 59,
 "deletions": 14,
 "changed_files": 5,
 "commit_count": 3,
 "size_bucket": "S",
 "mergeable_state": "clean",
 "bot": {
  "drahtbot": {
   "present": true,
   "reviews": {
    "concept_ack": [
     {
      "login": "Sjors",
      "url": "https://github.com/bitcoin/bitcoin/pull/36587#issuecomment-6460646505"
     }
    ]
   },
   "conflicts": []
  }
 },
 "acks_parsed": {
  "Sjors": {
   "kind": "concept_ack",
   "hash": null,
   "t": "2026-10-28T04:26:19Z",
   "stale": false
  }
 },
 "acks_tally": {
  "ack": 0,
  "stale_ack": 0,
  "concept_ack": 1,
  "approach_ack": 0,
  "nack": 0,
  "concept_nack": 0,
  "approach_nack": 0
 },
 "reviews": {
  "approved": 0,
  "changes_requested": 0,
  "distinct_reviewers": [
   "Sjors",
   "maflcko"
  ]
 },
 "signals": {
  "needs_rebase": false,
  "ci_failed": false,
  "mergeable_state": "clean",
  "last_author_activity": "2026-10-21T07:42:57Z",
  "last_reviewer_activity": "2026-10-28T06:08:36Z",
  "last_reviewer": "maflcko",
  "author_silent_days": 11,
  "waiting_on_author_days": 4,
  "days_since_update": 4
 },
 "refs": {
  "mentioned": [
   31537,
   34937
  ],
  "depends_on": [],
  "fixes": [],
  "linked_issues": [],
  "references": [
   {
    "number": 31537,
    "type": "pull",
    "state": "closed",
    "merged": true,
    "merged_at": "2024-12-30",
    "title": "qa: Limit `-maxconnections` in tests"
   },
   {
    "number": 34937,
    "type": "pull",
    "state": "closed",
    "merged": true,
    "merged_at": "2026-06-19",
    "title": "Fix startup failure with RLIM_INFINITY fd limits"
   }
  ],
  "conflicts": []
 },
 "stack": {
  "shares_commits_with": [],
  "based_on": [],
  "base_for": []
 },
 "review_paths": [
  "ci/test/wrap-fd-limit.sh"
 ],
 "body": "This PR fixes the `interface_ipc*.py` tests, which have been [failing](https://github.com/bitcoin/bitcoin/pull/35037#issuecomment-6082043240) on NetBSD since https://github.com/bitcoin/bitcoin/pull/35037.\n\nAs file descriptor budget regressions of this kind recur (see https://github.com/bitcoin/bitcoin/pull/31537 and https://github.com/bitcoin/bitcoin/pull/36078), the macOS CI job now models NetBSD's limit so they are caught before merging rather than by nightly NetBSD CI afterwards.\n\nSee the commit messages for details.",
 "commits": [
  {
   "sha": "956f807bdb7861c83b94d82bdee949a930fada3e",
   "date": "2026-10-21T07:20:20Z",
   "message": "qa, refactor: Move `-maxconnections` budget into named constant\n\nEasy to review using the following:\n```\ngit diff --color-moved=dimmed-zebra --color-moved-ws=allow-indentation-change\n```"
  },
  {
   "sha": "62571e7e67e184c46cde7968e12a76de5401c208",
   "date": "2026-10-21T07:20:43Z",
   "message": "qa: Account for `-ipcbind` file descriptors in `-maxconnections`\n\nSince `-ipcbind` reserves one listening socket plus\n`ipc::DEFAULT_MAX_CONNECTIONS` (16) client slots in `min_required_fds`,\nthe framework's `-maxconnections=76` no longer fits the 256 file\ndescriptor budget on NetBSD, and every `interface_ipc*.py` node starts\nwith \"Warning: Reducing -maxconnections ...\", which the framework treats\nas a failure.\n\nLower `-maxconnections` by that reservation on IPC-enabled nodes only,\nso the rest of the suite keeps its P2P connection slots."
  },
  {
   "sha": "311bc7c3bb274c7065f871198fa0910c205b8a6a",
   "date": "2026-10-21T07:30:01Z",
   "message": "ci: Enforce NetBSD's 256 file descriptor budget in the macOS job\n\nOn select()-based platforms such as NetBSD, `bitcoind` can use at most\n`FD_SETSIZE` (256) file descriptors, so the functional test framework\npins `-maxconnections` to that budget. Any change that grows\n`min_required_fds` then makes every node print \"Warning: Reducing\n-maxconnections ...\", which the framework treats as a failure. Such\nregressions are currently caught only by nightly NetBSD CI (see #31537,\n\nAdd a `CI_LIMIT_FD_COUNT` knob that runs functional test node processes\nthrough a wrapper capping `RLIMIT_NOFILE`, and enable it for the macOS\nnative job with NetBSD's value of 256."
  }
 ],
 "timeline": [
  {
   "t": "2026-10-21T07:42:57Z",
   "kind": "comment",
   "who": "hebasto",
   "assoc": "MEMBER",
   "text": "NetBSD test logs are available here: https://github.com/hebasto/bitcoin-core-nightly/actions/runs/39563835829.",
   "id": "c:6310777839",
   "url": "https://github.com/bitcoin/bitcoin/pull/36587#issuecomment-6310777839",
   "hash": "d163187b67d7c916",
   "edited": null
  },
  {
   "t": "2026-10-28T04:26:19Z",
   "kind": "comment",
   "who": "Sjors",
   "assoc": "MEMBER",
   "text": "Concept ACK\n\nBut `wrap-fd-limit.sh\u200e` in 311bc7c3bb274c7065f871198fa0910c205b8a6a loses our coverage for \"infinite\" file descriptors introduced by #34937.\n\nWe could run `feature_init.py` both capped and uncapped:\n\n```diff\ndiff --git a/ci/test/03_test_script.sh b/ci/test/03_test_script.sh\nindex d5981147f4..1468638690 100755\n--- a/ci/test/03_test_script.sh\n+++ b/ci/test/03_test_script.sh\n@@ -161,5 +161,6 @@ if [ -n \"${CI_LIMIT_FD_COUNT}\" ]; then\n   # Only the node processes are capped (via BITCOIN_CMD), not the Python\n   # test runner, which needs more descriptors when running jobs in parallel.\n-  export BITCOIN_CMD=\"${BASE_ROOT_DIR}/ci/test/wrap-fd-limit.sh ${BITCOIN_CMD:-bitcoin}\"\n+  BITCOIN_CMD_UNCAPPED=\"${BITCOIN_CMD:-bitcoin}\"\n+  export BITCOIN_CMD=\"${BASE_ROOT_DIR}/ci/test/wrap-fd-limit.sh ${BITCOIN_CMD_UNCAPPED}\"\n fi\n\n@@ -208,4 +209,20 @@ if [ \"$RUN_FUNCTIONAL_TESTS\" = \"true\" ]; then\n     --quiet \\\n     --failfast\n+\n+  if [ -n \"${CI_LIMIT_FD_COUNT}\" ]; then\n+    # The capped suite also runs feature_init.py, but the wrapper overrides the\n+    # RLIM_INFINITY and above-INT_MAX limits it tests. Repeat it without the cap.\n+    BITCOIN_CMD=\"${BITCOIN_CMD_UNCAPPED}\" \\\n+    LD_LIBRARY_PATH=\"${DEPENDS_DIR}/${HOST}/lib\" \\\n+    \"${BASE_BUILD_DIR}/test/functional/test_runner.py\" \\\n+      \"${MAKEJOBS}\" \\\n+      --tmpdirprefix \"${BASE_SCRATCH_DIR}/test_runner_uncapped/\" \\\n+      --ansi \\\n+      --combinedlogslen=99999999 \\\n+      --timeout-factor=\"${TEST_RUNNER_TIMEOUT_FACTOR}\" \\\n+      --quiet \\\n+      --failfast \\\n+      feature_init.py\n+  fi\n fi\n```\n\nAlternatively we could drop that test.",
   "id": "c:6460646505",
   "url": "https://github.com/bitcoin/bitcoin/pull/36587#issuecomment-6460646505",
   "hash": "253efd8fd28e467d",
   "edited": null
  },
  {
   "t": "2026-10-28T06:08:36Z",
   "kind": "review_comment",
   "who": "maflcko",
   "assoc": "MEMBER",
   "path": "ci/test/wrap-fd-limit.sh",
   "commit": "311bc7c3bb274c7065f871198fa0910c205b8a6a",
   "in_reply_to": null,
   "text": "missing pipefail and nounset? I guess the script may fail anyway when nounset is hit, but can't hurt to be explicit here",
   "id": "rc:4397446883",
   "url": "https://github.com/bitcoin/bitcoin/pull/36587#discussion_r4397446883",
   "hash": "5e75aebe8e4b5d7a",
   "edited": null
  }
 ],
 "labels_log": [
  {
   "t": "2026-10-21T07:32:10Z",
   "action": "labeled",
   "label": "Tests",
   "who": "DrahtBot"
  },
  {
   "t": "2026-10-21T07:41:28Z",
   "action": "labeled",
   "label": "CI failed",
   "who": "DrahtBot"
  },
  {
   "t": "2026-10-21T08:36:19Z",
   "action": "unlabeled",
   "label": "CI failed",
   "who": "DrahtBot"
  }
 ],
 "state_log": [
  {
   "t": "2026-10-21T07:32:28Z",
   "kind": "renamed",
   "who": "hebasto",
   "from": "qa: Fix `interface_ipc*.py` on NetBSD and prevent r",
   "to": "qa: Fix `interface_ipc*.py` on NetBSD and prevent future regressions"
  },
  {
   "t": "2026-10-21T07:32:36Z",
   "kind": "closed",
   "who": "hebasto"
  },
  {
   "t": "2026-10-21T07:39:49Z",
   "kind": "reopened",
   "who": "hebasto"
  }
 ],
 "text_chars": 3821,
 "text_tokens_estimate": 955,
 "changed_paths": [
  "ci/test/00_setup_env_mac_native.sh",
  "ci/test/03_test_script.sh",
  "ci/test/wrap-fd-limit.sh",
  "test/functional/test_framework/test_node.py",
  "test/functional/test_framework/util.py"
 ],
 "files": [
  {
   "path": "ci/test/00_setup_env_mac_native.sh",
   "add": 1,
   "del": 0
  },
  {
   "path": "ci/test/03_test_script.sh",
   "add": 6,
   "del": 0
  },
  {
   "path": "ci/test/wrap-fd-limit.sh",
   "add": 21,
   "del": 0
  },
  {
   "path": "test/functional/test_framework/test_node.py",
   "add": 7,
   "del": 0
  },
  {
   "path": "test/functional/test_framework/util.py",
   "add": 24,
   "del": 14
  }
 ],
 "test_lines": 73,
 "git": {
  "head": "311bc7c3bb274c7065f871198fa0910c205b8a6a",
  "head_matches_backup": true,
  "base": "4303f3b7f0775cdbbe77faddf142e1e44fa590ca",
  "patch_id": "53378f22358df5c7",
  "commits": [
   {
    "sha": "956f807bdb",
    "subject": "qa, refactor: Move `-maxconnections` budget into named constant",
    "files": 1,
    "add": 17,
    "del": 14
   },
   {
    "sha": "62571e7e67",
    "subject": "qa: Account for `-ipcbind` file descriptors in `-maxconnections`",
    "files": 2,
    "add": 13,
    "del": 0
   },
   {
    "sha": "311bc7c3bb",
    "subject": "ci: Enforce NetBSD's 256 file descriptor budget in the macOS job",
    "files": 4,
    "add": 29,
    "del": 0
   }
  ],
  "patch_truncated": false
 },
 "patch_id": "53378f22358df5c7",
 "input_hash": "fd8642827c39b675",
 "extracted_at": "2026-11-02T01:09:49+00:00"
}