Skip to content

test: keep the h2c unix socket path within sun_path limits - #5978

Merged
mcollina merged 1 commit into
mainfrom
test/h2c-unix-socket-short-path
Oct 8, 2026
Merged

mcollina merged 1 commit into
mainfrom
test/h2c-unix-socket-short-path

Conversation

@mcollina

@mcollina mcollina commented Oct 8, 2026

Copy link
Copy Markdown
Member

Summary

test/h2c-client.js › Connect to h2c server over a unix domain socket creates its socket under mkdtemp(os.tmpdir()). Under CITGM on macOS, TMPDIR points inside the CITGM work directory (/private/var/folders/…/T/<id>/npm_config_tmp), so the socket path exceeds the 104-byte sun_path limit.

Node.js 22 silently truncates such paths (so the test happens to pass), while Node.js 24 and 26 reject them with EINVAL — which is why citgm undici fails on macOS with Node.js 24/26 only.

This falls back to /tmp when the tmpdir()-based path would be too long.

Refs: nodejs/citgm#1185

Verification

  • With a ~110-char TMPDIR, the old test fails and the new one passes on Node.js 22.22.1, 24.21.0 and 26.9.0.
  • npx borp -p test/h2c-client.js: 12/12 pass.

The other citgm failures in that issue (Node.js 22 onread->IsFunction() abort) are handled by #5961.

os.tmpdir() can be long enough (e.g. under CITGM on macOS, where TMPDIR
points inside the CITGM work dir) that the socket path exceeds the
104-byte sun_path limit. Node.js >= 24 rejects such paths with EINVAL
instead of silently truncating them, so the test failed on Node.js 24
and 26. Fall back to /tmp when the path would be too long.

Refs: nodejs/citgm#1185
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.52%. Comparing base (2def924) to head (f025e3c).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5978   +/-   ##
=======================================
  Coverage   91.52%   91.52%           
=======================================
  Files         113      113           
  Lines       43537    43537           
=======================================
+ Hits        39847    39849    +2     
+ Misses       3690     3688    -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mcollina
mcollina merged commit caecf7a into main Oct 8, 2026
34 of 38 checks passed
@mcollina
mcollina deleted the test/h2c-unix-socket-short-path branch October 8, 2026 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants