Skip to content

Commit 3bc7b5e

Browse files
jnord99MylesBorins
authored andcommitted
test: skip failing tests for osx mojave
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]>
1 parent 75082ee commit 3bc7b5e

4 files changed

+38
-0
lines changed

test/common/index.js

+3
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ const isOpenBSD = process.platform === 'openbsd';
5757
const isLinux = process.platform === 'linux';
5858
const isOSX = process.platform === 'darwin';
5959

60+
const isOSXMojave = isOSX && (os.release().startsWith('18'));
61+
6062
const enoughTestMem = os.totalmem() > 0x70000000; /* 1.75 Gb */
6163
const cpus = os.cpus();
6264
const enoughTestCpu = Array.isArray(cpus) &&
@@ -711,6 +713,7 @@ module.exports = {
711713
isMainThread,
712714
isOpenBSD,
713715
isOSX,
716+
isOSXMojave,
714717
isSunOS,
715718
isWindows,
716719
localIPv6Hosts,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
'use strict';
2+
const common = require('../common');
3+
4+
// This test should fail on macOS (10.14) due to an issue with privileged ports.
5+
6+
const assert = require('assert');
7+
const cluster = require('cluster');
8+
const net = require('net');
9+
10+
if (!common.isOSXMojave)
11+
assert.fail('Code should fail only on macOS Mojave.');
12+
13+
14+
if (cluster.isMaster) {
15+
cluster.fork().on('exit', common.mustCall((exitCode) => {
16+
assert.strictEqual(exitCode, 0);
17+
}));
18+
} else {
19+
const s = net.createServer(common.mustNotCall());
20+
s.listen(42, common.mustNotCall('listen should have failed'));
21+
s.on('error', common.mustCall((err) => {
22+
assert.strictEqual(err.code, 'EACCES');
23+
process.disconnect();
24+
}));
25+
}

test/parallel/test-cluster-bind-privileged-port.js

+5
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@
2121

2222
'use strict';
2323
const common = require('../common');
24+
25+
// Skip on OS X Mojave. https://github.com/nodejs/node/issues/21679
26+
if (common.isOSXMojave)
27+
common.skip('bypass test for Mojave due to OSX issue');
28+
2429
if (common.isWindows)
2530
common.skip('not reliable on Windows.');
2631

test/parallel/test-cluster-shared-handle-bind-privileged-port.js

+5
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@
2121

2222
'use strict';
2323
const common = require('../common');
24+
25+
// Skip on OS X Mojave. https://github.com/nodejs/node/issues/21679
26+
if (common.isOSXMojave)
27+
common.skip('bypass test for Mojave due to OSX issue');
28+
2429
if (common.isWindows)
2530
common.skip('not reliable on Windows');
2631

0 commit comments

Comments
 (0)