remote_runner: Avoid searching the full text for "FINISHED"

pull/5020/head
Richard Hansen 2021-05-02 22:46:48 -04:00
parent 3409e3f5e6
commit a17556b876
1 changed files with 3 additions and 3 deletions

View File

@ -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;