Skip to content

Commit

Permalink
fix: handle error when opening initial url
Browse files Browse the repository at this point in the history
Example of the problem:
https://travis-ci.org/angular/angular.js/jobs/24101767#L2645
https://saucelabs.com/tests/edcfa4e9844f4a9ea8402366d8d2ebf7

For some reason (probably a network error on Travis), navigation to
Karma capture page failed. With this fix, it will fail the launcher and
therefore Karma will try to start the browser again. Even if the network
error would remain, at least Karma fails instead of waiting for Travis 
timeout.
  • Loading branch information
vojtajina committed Apr 30, 2014
1 parent e0a1412 commit 4aef4e9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/sauce_launcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,10 @@ var SauceLauncher = function(args, sauceConnect, /* config.sauceLabs */ config,

log.info('%s session at https://saucelabs.com/tests/%s', browserName, driver.sessionID);
log.debug('WebDriver channel for %s instantiated, opening %s', browserName, url);
return driver.get(url).then(heartbeat);
return driver.get(url).then(heartbeat, function(err) {
log.error('Can not start %s\n %s', browserName, formatSauceError(err));
return self._done('failure');
});
}, function(err) {
if (pendingCancellations > 0) {
pendingCancellations--;
Expand Down

0 comments on commit 4aef4e9

Please sign in to comment.