diff --git a/test/parallel/test-child-process-uid-gid.js b/test/parallel/test-child-process-uid-gid.js index 220cae633e112f..1ab514566cd93d 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(() => {