summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/parallel/test-child-process-uid-gid.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/parallel/test-child-process-uid-gid.js b/test/parallel/test-child-process-uid-gid.js
index 220cae633e..1ab514566c 100644
--- a/test/parallel/test-child-process-uid-gid.js
+++ b/test/parallel/test-child-process-uid-gid.js
@@ -3,6 +3,11 @@ const common = require('../common');
const assert = require('assert');
const spawn = require('child_process').spawn;
+if (process.getuid() === 0) {
+ common.skip('as this test should not be run as `root`');
+ return;
+}
+
const expectedError = common.isWindows ? /\bENOTSUP\b/ : /\bEPERM\b/;
assert.throws(() => {