Skip to content

Commit

Permalink
test: fix cluster-worker-isdead
Browse files Browse the repository at this point in the history
Check if the worker 'isDead' instead of 'isConnected' as the
'disconnect' event is not guaranteed to be received before the
'exit' event.
Remove the 'net' dependency as it is not used.
  • Loading branch information
santigimeno committed Nov 21, 2015
1 parent 8b97249 commit a3ffac7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions test/parallel/test-cluster-worker-isdead.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
require('../common');
var cluster = require('cluster');
var assert = require('assert');
var net = require('net');

if (cluster.isMaster) {
var worker = cluster.fork();
Expand All @@ -11,7 +10,7 @@ if (cluster.isMaster) {
'created.');

worker.on('exit', function() {
assert.ok(!worker.isConnected(),
assert.ok(worker.isDead(),
'After an event has been emitted, ' +
'isDead should return true');
});
Expand Down

0 comments on commit a3ffac7

Please sign in to comment.