Skip to content

Commit

Permalink
fix: remove heartbeat function (#205)
Browse files Browse the repository at this point in the history
  • Loading branch information
rcebulko committed Apr 28, 2020
1 parent c23ba6a commit 10e93cc
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions src/launcher/launcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,33 +34,9 @@ export function SaucelabsLauncher(args,
// Setup Browser name that will be printed out by Karma.
this.name = browserName + ' on SauceLabs';

let pendingHeartBeat;
const formatSauceError = (err) => {
return err.message + '\n' + (err.data ? ' ' + err.data : '')
}
// Heartbeat function to keep alive sessions on Sauce Labs via webdriver JSON wire calls
const heartbeat = () => {
pendingHeartBeat = setTimeout( (driver) => {
log.debug('Heartbeat to Sauce Labs (%s) - fetching title', browserName)

if (driver === undefined){
log.error('Heartbeat to %s failed: driver is null\n %s', browserName)

clearTimeout(pendingHeartBeat)
return this._done('failure')
}

driver.getTitle()
.then(null, (err) => {
log.error('Heartbeat to %s failed\n %s', browserName, formatSauceError(err))

clearTimeout(pendingHeartBeat)
return this._done('failure')
});

heartbeat()
}, 60000);
}

// Listen for the start event from Karma. I know, the API is a bit different to how you
// would expect, but we need to follow this approach unless we want to spend more work
Expand Down

0 comments on commit 10e93cc

Please sign in to comment.