Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion test/h2c-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,11 @@ test('Connect to h2c server over a unix domain socket', { skip: process.platform
const { join } = require('node:path')
const { tmpdir } = require('node:os')

const tmpDir = await mkdtemp(join(tmpdir(), 'h2c-client-'))
// Unix socket paths are limited to 104 bytes on macOS (108 on Linux), and
// Node.js >= 24 rejects longer ones with EINVAL instead of truncating them.
// os.tmpdir() can be long (e.g. under CITGM on macOS), so fall back to /tmp.
const base = join(tmpdir(), 'h2c-client-XXXXXX', 'server.sock').length < 104 ? tmpdir() : '/tmp'
const tmpDir = await mkdtemp(join(base, 'h2c-client-'))
const socketPath = join(tmpDir, 'server.sock')
const authority = 'localhost'

Expand Down
Loading