Skip to content

Commit

Permalink
Added standalone restart test
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Jul 18, 2011
1 parent d57e11d commit c8daab8
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions test/test.standalone-restart.js
@@ -0,0 +1,29 @@

/**
* Module dependencies.
*/

var cluster = require('../');

require('./common');

cluster = cluster()
.set('workers', 2)
.start();

if (cluster.isWorker) {
setTimeout(function(){
process.kill(process.env.CLUSTER_MASTER_PID, 'SIGUSR2');
}, 200);
} else {
if (process.env.CLUSTER_REPLACEMENT_MASTER) {
var err;
try {
// make sure the previous parent was killed
process.kill(process.env.PARENT_PID, 0);
} catch (e) {
err = e;
}
if (!err) throw new Error('parent is running');
}
}

0 comments on commit c8daab8

Please sign in to comment.