Skip to content

Commit c6b92b8

Browse files
santigimenoMyles Borins
authored and
Myles Borins
committed
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 <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Minwoo Jung <[email protected]>
1 parent 8b4038a commit c6b92b8

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

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

+1-2
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)