From fcc357ddd157c70a82313021483ae107631d9249 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Fri, 30 May 2014 14:58:36 -0400 Subject: [PATCH] Source cleanup of `onJobStart`. --- test/saucelabs.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/saucelabs.js b/test/saucelabs.js index 8dad1e474..85d3fa634 100644 --- a/test/saucelabs.js +++ b/test/saucelabs.js @@ -368,14 +368,14 @@ function onJobReset() { * @param {Object} body The response body JSON object. */ function onJobStart(error, res, body) { - var statusCode = _.result(res, 'statusCode'), - taskId = _.first(_.result(body, 'js tests')), - tunnel = this.tunnel; - this.starting = false; + if (this.stopping) { return; } + var statusCode = _.result(res, 'statusCode'), + taskId = _.first(_.result(body, 'js tests')); + if (error || !taskId || statusCode != 200) { if (this.attempts < this.retries) { this.restart();