aboutsummaryrefslogtreecommitdiff
path: root/test/ufuzz/job.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-10-16 14:56:54 +0100
committerGitHub <noreply@github.com>2020-10-16 21:56:54 +0800
commit42982019386ff0e29bd44af480c3f40e82b04d07 (patch)
tree8106a71acd35a2709aa79c6ffd2601764ae4f57f /test/ufuzz/job.js
parent4f833937fea193e466a33e2f03f21d0b909a407d (diff)
downloadtracifyjs-42982019386ff0e29bd44af480c3f40e82b04d07.tar.gz
tracifyjs-42982019386ff0e29bd44af480c3f40e82b04d07.zip
flush `stdout` from `ufuzz` jobs properly (#4224)
Diffstat (limited to 'test/ufuzz/job.js')
-rw-r--r--test/ufuzz/job.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/ufuzz/job.js b/test/ufuzz/job.js
index 20f6ee0e..52c057e8 100644
--- a/test/ufuzz/job.js
+++ b/test/ufuzz/job.js
@@ -48,8 +48,10 @@ function run() {
stderr = "";
child.stderr.on("data", trap).pipe(process.stdout);
log = setInterval(function() {
+ stdout = stdout.replace(/[^\r\n]+\r(?=[^\r\n]+\r)/g, "");
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);
}, 5 * 60 * 1000);
}