mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
test: deflake test-cluster-shared-handle-bind-privileged-port
PR-URL: https://github.com/nodejs/node/pull/55378 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
This commit is contained in:
parent
b76bcb3aad
commit
d3526af7ff
@ -35,6 +35,22 @@ if (common.isWindows)
|
||||
if (process.getuid() === 0)
|
||||
common.skip('as this test should not be run as `root`');
|
||||
|
||||
// Some systems won't have port 42 set as a privileged port, in that
|
||||
// case, skip the test.
|
||||
if (common.isLinux) {
|
||||
const { readFileSync } = require('fs');
|
||||
|
||||
try {
|
||||
const unprivilegedPortStart = parseInt(readFileSync('/proc/sys/net/ipv4/ip_unprivileged_port_start'));
|
||||
if (unprivilegedPortStart <= 42) {
|
||||
common.skip('Port 42 is unprivileged');
|
||||
}
|
||||
} catch {
|
||||
// Do nothing, feature doesn't exist, minimum is 1024 so 42 is usable.
|
||||
// Continue...
|
||||
}
|
||||
}
|
||||
|
||||
const assert = require('assert');
|
||||
const cluster = require('cluster');
|
||||
const net = require('net');
|
||||
|
Loading…
Reference in New Issue
Block a user