diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2020-09-19 13:31:37 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-19 20:31:37 +0800 |
commit | f0ae03ed3933fb967921924dc524f4cca8587ce4 (patch) | |
tree | e98ec7209ce08f302410c9a566c290ec48dda82f /test/ufuzz | |
parent | 31c6b45036ca67e94b55601ff99f19ea2ccd1036 (diff) | |
download | tracifyjs-f0ae03ed3933fb967921924dc524f4cca8587ce4.tar.gz tracifyjs-f0ae03ed3933fb967921924dc524f4cca8587ce4.zip |
report immediate `ufuzz` failure from Pull Request (#4128)
Diffstat (limited to 'test/ufuzz')
-rw-r--r-- | test/ufuzz/job.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/test/ufuzz/job.js b/test/ufuzz/job.js index fff0e044..5d4add83 100644 --- a/test/ufuzz/job.js +++ b/test/ufuzz/job.js @@ -2,14 +2,16 @@ var child_process = require("child_process"); var ping = 5 * 60 * 1000; var period = +process.argv[2]; -var endTime = Date.now() + period; +var endTime = period < 0 ? period : Date.now() + period; for (var i = 0; i < 2; i++) spawn(endTime); function spawn(endTime) { - var child = child_process.spawn("node", [ + var args = [ "--max-old-space-size=2048", "test/ufuzz" - ], { + ]; + if (endTime < 0) args.push(-endTime); + var child = child_process.spawn("node", args, { stdio: [ "ignore", "pipe", "pipe" ] }).on("exit", respawn); var stdout = ""; @@ -23,6 +25,7 @@ function spawn(endTime) { console.log(stdout.slice(stdout.lastIndexOf("\r", end - 1) + 1, end)); stdout = stdout.slice(end + 1); }, ping); + if (endTime < 0) return; var timer = setTimeout(function() { clearInterval(keepAlive); child.removeListener("exit", respawn); @@ -32,6 +35,7 @@ function spawn(endTime) { function respawn() { console.log(stdout.replace(/[^\r\n]*\r/g, "")); clearInterval(keepAlive); + if (endTime < 0) return; clearTimeout(timer); spawn(endTime); } |