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.

PR-URL: #3954
Reviewed-By: Jeremiah Senkpiel <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
  • Loading branch information
santigimeno authored and Myles Borins committed Dec 15, 2015
1 parent 8b4038a commit c6b92b8
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 c6b92b8

Please sign in to comment.