From f7a42edb131af2f3cfdc19c422e93d265038fbeb Mon Sep 17 00:00:00 2001 From: coreybeaumont Date: Sat, 22 Apr 2017 13:22:57 -0700 Subject: [PATCH 1/3] test: Added relative path to accommodate limit Found that libuv had a path character limit of 108. Used path.relative() to set prefix with relative path. --- test/parallel/test-net-connect-options-fd.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/parallel/test-net-connect-options-fd.js b/test/parallel/test-net-connect-options-fd.js index 5a0db83184ed0c..f37b4e128bbb77 100644 --- a/test/parallel/test-net-connect-options-fd.js +++ b/test/parallel/test-net-connect-options-fd.js @@ -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) { @@ -32,7 +33,8 @@ const forAllClients = (cb) => common.mustCall(cb, CLIENT_VARIANTS); // Test Pipe fd is wrapped correctly { - const prefix = `${common.PIPE}-net-connect-options-fd`; + const prefix = path.relative(`${common.PIPE}-net-connect-options-fd`, + `${__dirname}-net-connect-options-fd`); const serverPath = `${prefix}-server`; let counter = 0; let socketCounter = 0; From b1f370b3b0966d867799fe3435de3ded85172e1c Mon Sep 17 00:00:00 2001 From: coreybeaumont Date: Thu, 27 Apr 2017 11:09:16 -0700 Subject: [PATCH 2/3] test: improved call to path.relative() Improved the call to path.relative(). Also added comments explaining the use of a relative path. --- test/parallel/test-net-connect-options-fd.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-net-connect-options-fd.js b/test/parallel/test-net-connect-options-fd.js index f37b4e128bbb77..fdac4bfc91d4a6 100644 --- a/test/parallel/test-net-connect-options-fd.js +++ b/test/parallel/test-net-connect-options-fd.js @@ -33,8 +33,9 @@ const forAllClients = (cb) => common.mustCall(cb, CLIENT_VARIANTS); // Test Pipe fd is wrapped correctly { - const prefix = path.relative(`${common.PIPE}-net-connect-options-fd`, - `${__dirname}-net-connect-options-fd`); + // Using relative path on osx if the path is greaterthan 108 chars + // an AssertionError: -48 is thrown + const prefix = path.relative('.', `${common.PIPE}-net-connect-options-fd`); const serverPath = `${prefix}-server`; let counter = 0; let socketCounter = 0; From d97a6d826dc290e125190b48cb544ebd37b3213d Mon Sep 17 00:00:00 2001 From: coreybeaumont Date: Thu, 27 Apr 2017 15:50:16 -0700 Subject: [PATCH 3/3] test: improved comments Altered to comment to better reflect the use of a relative path. --- test/parallel/test-net-connect-options-fd.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-net-connect-options-fd.js b/test/parallel/test-net-connect-options-fd.js index fdac4bfc91d4a6..9cc581243f9b9f 100644 --- a/test/parallel/test-net-connect-options-fd.js +++ b/test/parallel/test-net-connect-options-fd.js @@ -33,8 +33,8 @@ const forAllClients = (cb) => common.mustCall(cb, CLIENT_VARIANTS); // Test Pipe fd is wrapped correctly { - // Using relative path on osx if the path is greaterthan 108 chars - // an AssertionError: -48 is thrown + // 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;