mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
604 B
25 lines
604 B
13 years ago
|
var common = require('../common');
|
||
|
var assert = require('assert');
|
||
|
var path = require('path');
|
||
|
|
||
|
var spawn = require('child_process').spawn;
|
||
13 years ago
|
var childPath = path.join(__dirname, '..', 'fixtures', 'parent-process-nonpersistent.js');
|
||
|
var persistentPid = -1;
|
||
13 years ago
|
|
||
13 years ago
|
var child = spawn(process.execPath, [ childPath ]);
|
||
|
|
||
|
child.stdout.on('data', function (data) {
|
||
|
persistentPid = parseInt(data, 10);
|
||
13 years ago
|
});
|
||
|
|
||
|
process.on('exit', function () {
|
||
13 years ago
|
assert(persistentPid !== -1);
|
||
|
assert.throws(function () {
|
||
|
process.kill(child.pid);
|
||
|
});
|
||
|
assert.doesNotThrow(function () {
|
||
|
process.kill(persistentPid);
|
||
|
});
|
||
13 years ago
|
});
|
||
|
|