Skip to content

Commit

Permalink
refactor standalone test slightly
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Jul 19, 2011
1 parent fb651b0 commit 50b3a89
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions test/test.standalone.restart.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,11 @@ cluster = cluster()
.use(cluster.debug())
.start();

if (!cluster.isMaster) {
return;
}

var parentId = process.env.CLUSTER_PARENT_PID;

cluster.on('listening', function() {
if (parentId) {
cluster.close();
return;
}
if (!cluster.isMaster) return;
var ppid = process.env.CLUSTER_PARENT_PID;

cluster.on('listening', function(){
if (ppid) return cluster.close();
cluster.restart();
setTimeout(function() {
throw new Error('Initial master process has turned into a zombie!');
Expand Down

0 comments on commit 50b3a89

Please sign in to comment.