From 0fea8f6081bb293c5c9be5147740aacc9e6a9b0e Mon Sep 17 00:00:00 2001 From: jn99 Date: Fri, 12 Oct 2018 10:36:32 -0700 Subject: [PATCH 1/4] test: skip failing tests for osx mojave --- test/common/index.js | 3 +++ test/parallel/test-cluster-bind-privileged-port.js | 4 ++++ .../test-cluster-shared-handle-bind-privileged-port.js | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/test/common/index.js b/test/common/index.js index 75fe2e1548ea8a..796655b13f5c18 100644 --- a/test/common/index.js +++ b/test/common/index.js @@ -58,6 +58,8 @@ const isOpenBSD = process.platform === 'openbsd'; const isLinux = process.platform === 'linux'; const isOSX = process.platform === 'darwin'; +const isOSXMojave = isOSX && (os.release().startsWith('18')); + const enoughTestMem = os.totalmem() > 0x70000000; /* 1.75 Gb */ const cpus = os.cpus(); const enoughTestCpu = Array.isArray(cpus) && @@ -723,6 +725,7 @@ module.exports = { isMainThread, isOpenBSD, isOSX, + isOSXMojave, isSunOS, isWindows, isWOW64, diff --git a/test/parallel/test-cluster-bind-privileged-port.js b/test/parallel/test-cluster-bind-privileged-port.js index 99f7a20c4946be..ad0eda6dd84d26 100644 --- a/test/parallel/test-cluster-bind-privileged-port.js +++ b/test/parallel/test-cluster-bind-privileged-port.js @@ -21,6 +21,10 @@ 'use strict'; const common = require('../common'); + +if (common.isOSXMojave) + common.skip('bypass test for Mojave due to OSX issue'); + if (common.isWindows) common.skip('not reliable on Windows.'); diff --git a/test/parallel/test-cluster-shared-handle-bind-privileged-port.js b/test/parallel/test-cluster-shared-handle-bind-privileged-port.js index 8f05b28fed3308..1fed28e112bf07 100644 --- a/test/parallel/test-cluster-shared-handle-bind-privileged-port.js +++ b/test/parallel/test-cluster-shared-handle-bind-privileged-port.js @@ -21,6 +21,10 @@ 'use strict'; const common = require('../common'); + +if (common.isOSXMojave) + common.skip('bypass test for Mojave due to OSX issue'); + if (common.isWindows) common.skip('not reliable on Windows'); From ebfb18ad8c269e085d609c8fae9255889897ca22 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Fri, 12 Oct 2018 13:45:08 -0700 Subject: [PATCH 2/4] Update test-cluster-bind-privileged-port.js --- test/parallel/test-cluster-bind-privileged-port.js | 1 + 1 file changed, 1 insertion(+) diff --git a/test/parallel/test-cluster-bind-privileged-port.js b/test/parallel/test-cluster-bind-privileged-port.js index ad0eda6dd84d26..9d155259c3789e 100644 --- a/test/parallel/test-cluster-bind-privileged-port.js +++ b/test/parallel/test-cluster-bind-privileged-port.js @@ -22,6 +22,7 @@ 'use strict'; const common = require('../common'); +// Skip on OS X Mojave. https://github.com/nodejs/node/issues/21679 if (common.isOSXMojave) common.skip('bypass test for Mojave due to OSX issue'); From 3ff9636f81f7ec0f0ad9247bc5fc6cdea044a87c Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Fri, 12 Oct 2018 13:45:28 -0700 Subject: [PATCH 3/4] Update test-cluster-shared-handle-bind-privileged-port.js --- test/parallel/test-cluster-shared-handle-bind-privileged-port.js | 1 + 1 file changed, 1 insertion(+) diff --git a/test/parallel/test-cluster-shared-handle-bind-privileged-port.js b/test/parallel/test-cluster-shared-handle-bind-privileged-port.js index 1fed28e112bf07..1edece30af6de9 100644 --- a/test/parallel/test-cluster-shared-handle-bind-privileged-port.js +++ b/test/parallel/test-cluster-shared-handle-bind-privileged-port.js @@ -22,6 +22,7 @@ 'use strict'; const common = require('../common'); +// Skip on OS X Mojave. https://github.com/nodejs/node/issues/21679 if (common.isOSXMojave) common.skip('bypass test for Mojave due to OSX issue'); From cbc55b0874bd9742fd33cb27a14b4dd94d0e48d9 Mon Sep 17 00:00:00 2001 From: Refael Ackermann Date: Mon, 15 Oct 2018 19:39:07 -0400 Subject: [PATCH 4/4] fixup! add known_issue --- .../test-cluster-bind-privileged-port.js | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 test/known_issues/test-cluster-bind-privileged-port.js diff --git a/test/known_issues/test-cluster-bind-privileged-port.js b/test/known_issues/test-cluster-bind-privileged-port.js new file mode 100644 index 00000000000000..6ada04aa030b31 --- /dev/null +++ b/test/known_issues/test-cluster-bind-privileged-port.js @@ -0,0 +1,25 @@ +'use strict'; +const common = require('../common'); + +// This test should fail on macOS (10.14) due to an issue with privileged ports. + +const assert = require('assert'); +const cluster = require('cluster'); +const net = require('net'); + +if (!common.isOSXMojave) + assert.fail('Code should fail only on macOS Mojave.'); + + +if (cluster.isMaster) { + cluster.fork().on('exit', common.mustCall((exitCode) => { + assert.strictEqual(exitCode, 0); + })); +} else { + const s = net.createServer(common.mustNotCall()); + s.listen(42, common.mustNotCall('listen should have failed')); + s.on('error', common.mustCall((err) => { + assert.strictEqual(err.code, 'EACCES'); + process.disconnect(); + })); +}