Skip to content

Commit

Permalink
fix(launcher): ignore exit code when killing/timeouting
Browse files Browse the repository at this point in the history
Most of the browsers returns "not-normally" (because of receiving a signal) and therefore exit event gets null exit code. But PhantomJS exits "normally" with status code 1 (after receiving TERM signal).

I think this logic is better - show error, if process exits during a state which does not expect exiting (CAPTURED, BEING_CAPTURED).

Closes #444
  • Loading branch information
vojtajina committed May 12, 2013
1 parent 3940117 commit 1029bf2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/launchers/Base.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,14 @@ var BaseBrowser = function(id, emitter, captureTimeout, retryLimit) {
this._onProcessExit = function(code, errorOutput) {
log.debug('Process %s exitted with code %d', self.name, code);

if (code) {
if (self.state === BEING_CAPTURED) {
log.error('Cannot start %s\n\t%s', self.name, errorOutput);
}

if (self.state === CAPTURED) {
log.error('%s crashed.\n\t%s', self.name, errorOutput);
}

retryLimit--;

if (self.state === BEING_CAPTURED || self.state === BEING_TIMEOUTED) {
Expand Down

0 comments on commit 1029bf2

Please sign in to comment.