From 1905f8ef55c4ff96c49b37d4c74a08176ac70dad Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Tue, 22 Jan 2019 19:27:14 -0800 Subject: [PATCH] test: remove common.isOSXMojave common.isOSXMojave was added because it was believed that there was a bug in macOS Mojave that allowed unprivileged users to bind to privileged ports. As it turns out, that was a feature not a bug. It is likely to be in all future versions of macOS. Remove isOSXMojave and skip appropriate tests based on isOSX. Refs: https://news.ycombinator.com/item?id=18302380 PR-URL: https://github.com/nodejs/node/pull/25658 Reviewed-By: Refael Ackermann Reviewed-By: Colin Ihrig Reviewed-By: Beth Griggs Reviewed-By: Benjamin Gruenbaum Reviewed-By: Luigi Pinca Reviewed-By: Gus Caplan Reviewed-By: Minwoo Jung --- 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, 4 insertions(+), 7 deletions(-) diff --git a/test/common/index.js b/test/common/index.js index 308d737618955b..2c1eae7e410650 100644 --- a/test/common/index.js +++ b/test/common/index.js @@ -99,8 +99,6 @@ 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) && @@ -750,7 +748,6 @@ module.exports = { isMainThread, isOpenBSD, isOSX, - isOSXMojave, isSunOS, isWindows, localIPv6Hosts, diff --git a/test/parallel/test-cluster-bind-privileged-port.js b/test/parallel/test-cluster-bind-privileged-port.js index 9d155259c3789e..e95768a8fcc2b4 100644 --- a/test/parallel/test-cluster-bind-privileged-port.js +++ b/test/parallel/test-cluster-bind-privileged-port.js @@ -23,8 +23,8 @@ 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.isOSX) + common.skip('macOS may allow ordinary processes to use any port'); 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 1edece30af6de9..d8fae065fa15ff 100644 --- a/test/parallel/test-cluster-shared-handle-bind-privileged-port.js +++ b/test/parallel/test-cluster-shared-handle-bind-privileged-port.js @@ -23,8 +23,8 @@ 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.isOSX) + common.skip('macOS may allow ordinary processes to use any port'); if (common.isWindows) common.skip('not reliable on Windows');