From f0ae03ed3933fb967921924dc524f4cca8587ce4 Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Sat, 19 Sep 2020 13:31:37 +0100 Subject: [PATCH] report immediate `ufuzz` failure from Pull Request (#4128) --- .github/workflows/ufuzz.yml | 2 +- test/ufuzz/job.js | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ufuzz.yml b/.github/workflows/ufuzz.yml index 4a55eb48..88c235f1 100644 --- a/.github/workflows/ufuzz.yml +++ b/.github/workflows/ufuzz.yml @@ -36,7 +36,7 @@ jobs: npm config set update-notifier false npm --version while !(npm install); do echo "'npm install' failed - retrying..."; done - PERIOD=1800000 + PERIOD=-2000 if [[ $CAUSE == "schedule" ]]; then PERIOD=`node test/ufuzz/actions $BASE_URL $TOKEN` fi 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); } -- 2.34.1