mirror of
https://github.com/nodejs/node.git
synced 2025-05-05 15:32:15 +00:00

PR-URL: https://github.com/nodejs/node/pull/8622 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yorkie Liu <yorkiefixer@gmail.com> Reviewed-By: Jackson Tian <shvyo1987@gmail.com> Reviewed-By: Johan Bergström <bugs@bergstroem.nu> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Teddy Katz <teddy.katz@gmail.com>
26 lines
656 B
JavaScript
26 lines
656 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
const path = require('path');
|
|
|
|
const spawn = require('child_process').spawn;
|
|
const childPath = path.join(common.fixturesDir,
|
|
'parent-process-nonpersistent.js');
|
|
let persistentPid = -1;
|
|
|
|
const child = spawn(process.execPath, [ childPath ]);
|
|
|
|
child.stdout.on('data', function(data) {
|
|
persistentPid = parseInt(data, 10);
|
|
});
|
|
|
|
process.on('exit', function() {
|
|
assert.notStrictEqual(persistentPid, -1);
|
|
assert.throws(function() {
|
|
process.kill(child.pid);
|
|
});
|
|
assert.doesNotThrow(function() {
|
|
process.kill(persistentPid);
|
|
});
|
|
});
|