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
576 B

'use strict';
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);
});
}