Permalink
Browse files

[test minor] A couple of small updates for tests after recent API cha…

…nges. Readd Worker.exitOnStop
  • Loading branch information...
1 parent 3888dbd commit 1f78240ab7d37f5f0be916274e148ec662fab853 @indexzero indexzero committed Jan 5, 2012
View
@@ -404,7 +404,8 @@ forever.startServer = function () {
async.map(monitors, function (monitor, next) {
var worker = new forever.Worker({
monitor: monitor,
- sockPath: forever.config.get('sockPath')
+ sockPath: forever.config.get('sockPath'),
+ exitOnStop: true
});
worker.start(function (err) {
@@ -10,7 +10,6 @@ var fs = require('fs'),
path = require('path'),
util = require('util'),
events = require('events'),
- dnode = require('dnode'),
portfinder = require('portfinder'),
forever = require('../../forever'),
SystemVAdapter = require('./adapters/systemv');
View
@@ -30,7 +30,7 @@ var Worker = exports.Worker = function (options) {
this.monitor = options.monitor;
this.sockPath = options.sockPath || forever.config.get('sockPath');
- this.exitOnKill = options.exitOnKill === true;
+ this.exitOnStop = options.exitOnStop === true;
this._socket = null;
};
@@ -71,7 +71,7 @@ Worker.prototype.start = function (callback) {
socket.data(['stop'], function () {
self.monitor.once('stop', function () {
socket.send(['stop', 'ok']);
- process.exit();
+ self.exitOnStop && process.exit();
});
self.monitor.stop();
@@ -17,7 +17,7 @@ MonitorMock.prototype.__defineGetter__('data', function () {
}
});
-MonitorMock.prototype.kill = function (forceStop) {
+MonitorMock.prototype.kill = MonitorMock.prototype.stop = function (forceStop) {
this.running = false;
this.emit('stop');
@@ -68,6 +68,9 @@ vows.describe('forever/workers/multiple').addBatch({
},
"requests against the first child": assertRunning(8080),
"requests against the second child": assertRunning(8081)
+ //
+ // TODO: We should cleanup these processes.
+ //
}
},
}).export(module);
@@ -39,8 +39,8 @@ vows.describe('forever/worker/simple').addBatch({
var self = this;
options.monitor.running = true;
- reader.send(['kill']);
- reader.data(['kill', 'stop'], function () {
+ reader.send(['stop']);
+ reader.data(['stop', 'ok'], function () {
self.callback(null, options.monitor);
});
},

0 comments on commit 1f78240

Please sign in to comment.