From 355edf585be31fa18e0ed8efa5ab1ec9341624c7 Mon Sep 17 00:00:00 2001 From: Santiago Gimeno Date: Sat, 21 Nov 2015 15:33:51 +0100 Subject: [PATCH] test: fix cluster-worker-isdead MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: https://github.com/nodejs/node/pull/3954 Reviewed-By: Jeremiah Senkpiel Reviewed-By: Colin Ihrig Reviewed-By: Michaƫl Zasso Reviewed-By: Minwoo Jung --- test/parallel/test-cluster-worker-isdead.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/parallel/test-cluster-worker-isdead.js b/test/parallel/test-cluster-worker-isdead.js index 70a96539851398..90454cb86089a7 100644 --- a/test/parallel/test-cluster-worker-isdead.js +++ b/test/parallel/test-cluster-worker-isdead.js @@ -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(); @@ -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'); });