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
575 B
25 lines
575 B
var common = require('../common');
|
|
var assert = require('assert');
|
|
var cluster = require('cluster');
|
|
|
|
if (!cluster.isMaster) {
|
|
process.exit(42);
|
|
}
|
|
else {
|
|
var seenExit = 0;
|
|
var seenDeath = 0;
|
|
var worker = cluster.fork();
|
|
worker.on('exit', function(exitCode, signalCode) {
|
|
assert.equal(exitCode, 42);
|
|
assert.equal(signalCode, null);
|
|
seenExit++;
|
|
});
|
|
cluster.on('exit', function(worker_) {
|
|
assert.equal(worker_, worker);
|
|
seenDeath++;
|
|
});
|
|
process.on('exit', function() {
|
|
assert.equal(seenExit, 1);
|
|
assert.equal(seenDeath, 1);
|
|
});
|
|
}
|
|
|