Skip to content

Commit 355edf5

Browse files
santigimenojasnell
authored andcommitted
test: fix cluster-worker-isdead
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>
1 parent f93d268 commit 355edf5

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

test/parallel/test-cluster-worker-isdead.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
require('../common');
33
var cluster = require('cluster');
44
var assert = require('assert');
5-
var net = require('net');
65

76
if (cluster.isMaster) {
87
var worker = cluster.fork();
@@ -11,7 +10,7 @@ if (cluster.isMaster) {
1110
'created.');
1211

1312
worker.on('exit', function() {
14-
assert.ok(!worker.isConnected(),
13+
assert.ok(worker.isDead(),
1514
'After an event has been emitted, ' +
1615
'isDead should return true');
1716
});

0 commit comments

Comments
 (0)