-
Notifications
You must be signed in to change notification settings - Fork 947
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[api] Allow for forced exit if scripts restart in less than
minUptime
- Loading branch information
Showing
3 changed files
with
39 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
throw new Error('Dont spin restart') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* forever-test.js: Tests for forever module | ||
* | ||
* (C) 2010 and Charlie Robbins | ||
* MIT LICENCE | ||
* | ||
*/ | ||
|
||
require.paths.unshift(require('path').join(__dirname, '..', 'lib')); | ||
|
||
var sys = require('sys'), | ||
assert = require('assert'), | ||
path = require('path'), | ||
vows = require('vows'), | ||
forever = require('forever'); | ||
|
||
vows.describe('forever').addBatch({ | ||
"When using forever": { | ||
"and spawning a script that spin restarts": { | ||
topic: function () { | ||
var script = path.join(__dirname, '..', 'examples', 'always-throw.js'), | ||
child = new (forever.Forever)(script, { silent: true }); | ||
|
||
child.on('exit', this.callback.bind(null, null)); | ||
child.start(); | ||
}, | ||
"should spawn both processes appropriately": function (err, monitor, spinning) { | ||
assert.isTrue(spinning); | ||
} | ||
} | ||
}, | ||
}).export(module); |