test: fix test-debug-port-numbers on OS X

According to kill(2), kill returns `EPERM` error if when signalling a
process group any of the members could not be signalled.

PR-URL: https://github.com/nodejs/node/pull/7046
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This commit is contained in:
Santiago Gimeno authored and Rod Vagg committed 2016-06-02 22:42:01 +10:00
1 parent 14b3ba35fc
commit b23cd48ca0
1 file changed
+3 -1
+3 -1
View File
@@ -44,7 +44,9 @@ function kill(child) {
try {
process.kill(-child.pid); // Kill process group.
} catch (e) {
assert.strictEqual(e.code, 'ESRCH'); // Already gone.
// Generally ESRCH is returned when the process group is already gone. On
// some platforms such as OS X it may be EPERM though.
assert.ok((e.code === 'EPERM') || (e.code === 'ESRCH'));
}
}