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 <fishrock123@rocketmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Minwoo Jung <jmwsoft@gmail.com>
  • Loading branch information
santigimeno authored and JungMinu committed Dec 5, 2015
1 parent 7239494 commit f8cf947
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 f8cf947

Please sign in to comment.