Skip to content

Commit

Permalink
test: fix test-cluster-net-listen-relative-path.js to run in /
Browse files Browse the repository at this point in the history
test-cluster-net-listen-relative-path fails if run from the root
directory on POSIX because the socket filename isn't quite long enough.
Increase it by 2 so that the path length always exceeds 100 characters.

PR-URL: #34820
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Ricky Zhou <[email protected]>
  • Loading branch information
Trott authored and addaleax committed Sep 22, 2020
1 parent cc98103 commit d016cdc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/parallel/test-cluster-net-listen-relative-path.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const tmpdir = require('../common/tmpdir');

// Choose a socket name such that the absolute path would exceed 100 bytes.
const socketDir = './unix-socket-dir';
const socketName = 'A'.repeat(100 - socketDir.length - 1);
const socketName = 'A'.repeat(101 - socketDir.length);

// Make sure we're not in a weird environment.
assert.ok(path.resolve(socketDir, socketName).length > 100,
Expand Down

0 comments on commit d016cdc

Please sign in to comment.