From c59f8c734a81159c940a6de58d01fd651d96872c Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Tue, 29 Apr 2014 08:17:17 -0700 Subject: [PATCH] Apply `idle-timeout` to queued jobs too. --- test/saucelabs.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/saucelabs.js b/test/saucelabs.js index a9d8d5525..f6743b155 100644 --- a/test/saucelabs.js +++ b/test/saucelabs.js @@ -310,6 +310,7 @@ function check() { */ function onCheck(error, response, body) { var data = _.result(body, 'js tests', [{}])[0], + elapsed = (_.now() - this.timestamp) / 1000, options = this.options, platform = options.platforms[0], result = data.result, @@ -318,8 +319,7 @@ function onCheck(error, response, body) { failures = _.result(result, 'failed'), label = options.name + ':'; - if (!completed) { - console.dir(body); + if (!completed && elapsed < idleTimeout) { setTimeout(check.bind(this), statusInterval); return; } @@ -366,6 +366,7 @@ function onRun(error, response, body) { process.exit(3); } this.id = id; + this.timestamp = _.now(); check.call(this); }