From c14e4d5bd56de06f6fb521dd22260a95ad092fec Mon Sep 17 00:00:00 2001 From: = <=> Date: Thu, 13 Jun 2019 17:14:33 -0700 Subject: [PATCH] test: use .code for error in setgid When the 'nobody' user is missing use .code to detect this, its more robust than than the .message string. Refs: https://github.com/nodejs/node/issues/19594 PR-URL: https://github.com/nodejs/node/pull/28219 Reviewed-By: Sam Roberts Reviewed-By: Luigi Pinca Reviewed-By: Yongsheng Zhang Reviewed-By: Rich Trott Reviewed-By: Trivikram Kamat Reviewed-By: Colin Ihrig Reviewed-By: Yuta Hiroto Reviewed-By: Anto Aravinth --- test/parallel/test-process-uid-gid.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/parallel/test-process-uid-gid.js b/test/parallel/test-process-uid-gid.js index 49086792b9e7b1..dd11a2ec6e089d 100644 --- a/test/parallel/test-process-uid-gid.js +++ b/test/parallel/test-process-uid-gid.js @@ -74,7 +74,7 @@ const oldgid = process.getgid(); try { process.setgid('nobody'); } catch (err) { - if (err.message !== 'setgid group id does not exist') { + if (err.code !== 'ERR_UNKNOWN_CREDENTIAL') { throw err; } process.setgid('nogroup');