From a7cd0a4b2597b7a24ad85b605fb1c7e6598e4f5f Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Sun, 2 May 2021 21:44:02 -0400 Subject: [PATCH] remote_runner: Avoid re-sending the same console text over and over --- src/tests/frontend/travis/remote_runner.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tests/frontend/travis/remote_runner.js b/src/tests/frontend/travis/remote_runner.js index d7d05d2ec..49f735903 100644 --- a/src/tests/frontend/travis/remote_runner.js +++ b/src/tests/frontend/travis/remote_runner.js @@ -50,7 +50,8 @@ const sauceTestWorker = async.queue(async ({name, pfx, testSettings}) => { // how many characters of the log have been sent to travis let logIndex = 0; while (true) { - const consoleText = (await browser.eval("$('#console').text()") || '').substring(logIndex); + const remoteFn = ($, skipChars) => $('#console').text().substring(skipChars); + const consoleText = await browser.eval(`(${remoteFn})($, ${JSON.stringify(logIndex)})`); (consoleText ? consoleText.split('\n') : []).forEach((line) => log(line, pfx)); logIndex += consoleText.length; const [finished, nFailedStr] = consoleText.match(finishedRegex) || [];