flush stdout from ufuzz jobs properly (#4224)

This commit is contained in:
Alex Lam S.L
2020-10-16 14:56:54 +01:00
committed by GitHub
parent 4f833937fe
commit 4298201938
2 changed files with 4 additions and 1 deletions

View File

@@ -331,6 +331,7 @@ function strictMode() {
function createTopLevelCode() { function createTopLevelCode() {
VAR_NAMES.length = INITIAL_NAMES_LEN; // prune any previous names still in the list VAR_NAMES.length = INITIAL_NAMES_LEN; // prune any previous names still in the list
block_vars.length = 0;
unique_vars.length = 0; unique_vars.length = 0;
loops = 0; loops = 0;
funcs = 0; funcs = 0;

View File

@@ -48,8 +48,10 @@ function run() {
stderr = ""; stderr = "";
child.stderr.on("data", trap).pipe(process.stdout); child.stderr.on("data", trap).pipe(process.stdout);
log = setInterval(function() { log = setInterval(function() {
stdout = stdout.replace(/[^\r\n]+\r(?=[^\r\n]+\r)/g, "");
var end = stdout.lastIndexOf("\r"); var end = stdout.lastIndexOf("\r");
console.log(stdout.slice(stdout.lastIndexOf("\r", end - 1) + 1, end)); if (end < 0) return;
console.log(stdout.slice(0, end));
stdout = stdout.slice(end + 1); stdout = stdout.slice(end + 1);
}, 5 * 60 * 1000); }, 5 * 60 * 1000);
} }