From ae8a73993d898ae5a78190ea1239a73d0690869b Mon Sep 17 00:00:00 2001 From: Wyatt Preul Date: Fri, 30 Sep 2016 12:34:30 -0500 Subject: [PATCH] test: fix running child-process-uid-gid as root --- test/parallel/test-child-process-uid-gid.js | 5 +++++ 1 file changed, 5 insertions(+) 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(() => {