remote_runner: Avoid searching the full text for "FINISHED"

This commit is contained in:
Richard Hansen 2021-05-02 22:46:48 -04:00
parent 3409e3f5e6
commit a17556b876

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 // how many characters of the log have been sent to travis
let logIndex = 0; let logIndex = 0;
while (true) { while (true) {
const consoleText = await browser.eval("$('#console').text()") || ''; const consoleText = (await browser.eval("$('#console').text()") || '').substring(logIndex);
consoleText.substring(logIndex).split('\n').forEach((line) => log(line, pfx)); consoleText.split('\n').forEach((line) => log(line, pfx));
logIndex = consoleText.length; logIndex += consoleText.length;
const [finished, nFailedStr] = consoleText.match(finishedRegex) || []; const [finished, nFailedStr] = consoleText.match(finishedRegex) || [];
if (finished) { if (finished) {
if (nFailedStr !== '0') process.exitCode = 1; if (nFailedStr !== '0') process.exitCode = 1;