Skip to content

Commit

Permalink
[fix test] Make test/monitor/fork-test.js idempotent for processes cr…
Browse files Browse the repository at this point in the history
…eated
  • Loading branch information
indexzero committed Jan 15, 2012
1 parent b6daac5 commit 1f4f5dc
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions test/monitor/fork-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,23 @@ vows.describe('forever/monitor/fork').addBatch({
"with `forkShim` true": {
topic: function () {
var script = path.join(__dirname, '..', '..', 'examples', 'process-send.js'),
child = new (forever.Monitor)(script, {
silent: false,
minUptime: 2000,
max: 1,
fork: true,
forkShim: true
});
child

child = this.child = new (forever.Monitor)(script, {
silent: false,
minUptime: 2000,
max: 1,
fork: true,
forkShim: true
});

child.on('message', this.callback.bind(null, null));
child.on('message', this.callback.bind(this, null));
child.start();
},
"should reemit the message correctly": function (err, msg) {
assert.isObject(msg);
assert.deepEqual(msg, { from: 'child' });
this.child.child.kill();
}
}
}
Expand Down

0 comments on commit 1f4f5dc

Please sign in to comment.