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.
26 lines
575 B
26 lines
575 B
13 years ago
|
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();
|
||
13 years ago
|
worker.on('exit', function(exitCode, signalCode) {
|
||
|
assert.equal(exitCode, 42);
|
||
|
assert.equal(signalCode, null);
|
||
13 years ago
|
seenExit++;
|
||
|
});
|
||
13 years ago
|
cluster.on('exit', function(worker_) {
|
||
13 years ago
|
assert.equal(worker_, worker);
|
||
|
seenDeath++;
|
||
|
});
|
||
|
process.on('exit', function() {
|
||
|
assert.equal(seenExit, 1);
|
||
|
assert.equal(seenDeath, 1);
|
||
|
});
|
||
|
}
|