Skip to content

Commit

Permalink
test: add relative path to accommodate limit
Browse files Browse the repository at this point in the history
Found that libuv had a path character limit of 108.

Used path.relative() to set prefix with relative path.

Also added comments explaining the use of a relative path.

PR-URL: #12601
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Gibson Fahnestock <[email protected]>
  • Loading branch information
coreybeaumont authored and Trott committed Apr 28, 2017
1 parent 1052383 commit 0101a8f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/parallel/test-net-connect-options-fd.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
const common = require('../common');
const assert = require('assert');
const net = require('net');
const path = require('path');
const Pipe = process.binding('pipe_wrap').Pipe;

if (common.isWindows) {
Expand Down Expand Up @@ -32,7 +33,9 @@ const forAllClients = (cb) => common.mustCall(cb, CLIENT_VARIANTS);

// Test Pipe fd is wrapped correctly
{
const prefix = `${common.PIPE}-net-connect-options-fd`;
// Use relative path to avoid hitting 108-char length limit
// for socket paths in libuv.
const prefix = path.relative('.', `${common.PIPE}-net-connect-options-fd`);
const serverPath = `${prefix}-server`;
let counter = 0;
let socketCounter = 0;
Expand Down

0 comments on commit 0101a8f

Please sign in to comment.