From a17556b8765fe4d48b22baa86389bec9e729f68f Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Sun, 2 May 2021 22:46:48 -0400 Subject: [PATCH] remote_runner: Avoid searching the full text for "FINISHED" --- src/tests/frontend/travis/remote_runner.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tests/frontend/travis/remote_runner.js b/src/tests/frontend/travis/remote_runner.js index 047095a19..aa1be1066 100644 --- a/src/tests/frontend/travis/remote_runner.js +++ b/src/tests/frontend/travis/remote_runner.js @@ -50,9 +50,9 @@ 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()") || ''; - consoleText.substring(logIndex).split('\n').forEach((line) => log(line, pfx)); - logIndex = consoleText.length; + const consoleText = (await browser.eval("$('#console').text()") || '').substring(logIndex); + consoleText.split('\n').forEach((line) => log(line, pfx)); + logIndex += consoleText.length; const [finished, nFailedStr] = consoleText.match(finishedRegex) || []; if (finished) { if (nFailedStr !== '0') process.exitCode = 1;