From 9f15bc40b8849623f1d2ca9934e9b827d4e0e94d Mon Sep 17 00:00:00 2001 From: jn99 Date: Fri, 12 Oct 2018 10:36:32 -0700 Subject: [PATCH] test: skip failing tests for osx mojave MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refs: https://github.com/nodejs/node/issues/21679 PR-URL: https://github.com/nodejs/node/pull/23550 Reviewed-By: Ruben Bridgewater Reviewed-By: George Adams Reviewed-By: Gus Caplan Reviewed-By: James M Snell Reviewed-By: Santiago Gimeno Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: Trivikram Kamat Reviewed-By: Michael Dawson Reviewed-By: Сковорода Никита Андреевич --- test/common/index.js | 3 ++- .../test-cluster-bind-privileged-port.js | 25 +++++++++++++++++++ .../test-cluster-bind-privileged-port.js | 5 ++++ ...ster-shared-handle-bind-privileged-port.js | 5 ++++ 4 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 test/known_issues/test-cluster-bind-privileged-port.js diff --git a/test/common/index.js b/test/common/index.js index 2ff682e95d1347..fafea8d17f8474 100644 --- a/test/common/index.js +++ b/test/common/index.js @@ -47,7 +47,8 @@ exports.isSunOS = process.platform === 'sunos'; exports.isFreeBSD = process.platform === 'freebsd'; exports.isOpenBSD = process.platform === 'openbsd'; exports.isLinux = process.platform === 'linux'; -exports.isOSX = process.platform === 'darwin'; +const isOSX = exports.isOSX = process.platform === 'darwin'; +exports.isOSXMojave = isOSX && (os.release().startsWith('18')); exports.enoughTestMem = os.totalmem() > 0x70000000; /* 1.75 Gb */ const cpus = os.cpus(); 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(); + })); +} diff --git a/test/parallel/test-cluster-bind-privileged-port.js b/test/parallel/test-cluster-bind-privileged-port.js index 99f7a20c4946be..9d155259c3789e 100644 --- a/test/parallel/test-cluster-bind-privileged-port.js +++ b/test/parallel/test-cluster-bind-privileged-port.js @@ -21,6 +21,11 @@ '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'); + 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..1edece30af6de9 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,11 @@ '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'); + if (common.isWindows) common.skip('not reliable on Windows');