Skip to content

Commit

Permalink
test: skip failing tests for osx mojave
Browse files Browse the repository at this point in the history
Refs: #21679
PR-URL: #23550
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: George Adams <[email protected]>
Reviewed-By: Gus Caplan <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Santiago Gimeno <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Сковорода Никита Андреевич <[email protected]>
  • Loading branch information
jnord99 authored and MylesBorins committed Nov 29, 2018
1 parent 75082ee commit 3bc7b5e
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/common/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,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) &&
Expand Down Expand Up @@ -711,6 +713,7 @@ module.exports = {
isMainThread,
isOpenBSD,
isOSX,
isOSXMojave,
isSunOS,
isWindows,
localIPv6Hosts,
Expand Down
25 changes: 25 additions & 0 deletions test/known_issues/test-cluster-bind-privileged-port.js
Original file line number Diff line number Diff line change
@@ -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();
}));
}
5 changes: 5 additions & 0 deletions test/parallel/test-cluster-bind-privileged-port.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down

0 comments on commit 3bc7b5e

Please sign in to comment.