remote_runner: Avoid re-sending the same console text over and over

pull/5020/head
Richard Hansen 2021-05-02 21:44:02 -04:00
parent 25275f2744
commit a7cd0a4b25
1 changed files with 2 additions and 1 deletions

View File

@ -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) || [];