diff --git a/test/simple/test-cluster-disconnect.js b/test/simple/test-cluster-disconnect.js index 8fbdb93385..797c17d767 100644 --- a/test/simple/test-cluster-disconnect.js +++ b/test/simple/test-cluster-disconnect.js @@ -35,6 +35,7 @@ if (cluster.isWorker) { }).listen(common.PORT + 1, '127.0.0.1'); } else if (cluster.isMaster) { + var servers = 2; // test a single TCP server var testConnection = function(port, cb) { @@ -52,7 +53,6 @@ if (cluster.isWorker) { // test both servers created in the cluster var testCluster = function(cb) { - var servers = 2; var done = 0; for (var i = 0, l = servers; i < l; i++) { @@ -76,7 +76,7 @@ if (cluster.isWorker) { var worker = cluster.fork(); worker.on('listening', function() { online += 1; - if (online === workers) { + if (online === workers * servers) { cb(); } });