aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-09-19 13:31:37 +0100
committerGitHub <noreply@github.com>2020-09-19 20:31:37 +0800
commitf0ae03ed3933fb967921924dc524f4cca8587ce4 (patch)
treee98ec7209ce08f302410c9a566c290ec48dda82f
parent31c6b45036ca67e94b55601ff99f19ea2ccd1036 (diff)
downloadtracifyjs-f0ae03ed3933fb967921924dc524f4cca8587ce4.tar.gz
tracifyjs-f0ae03ed3933fb967921924dc524f4cca8587ce4.zip
report immediate `ufuzz` failure from Pull Request (#4128)
-rw-r--r--.github/workflows/ufuzz.yml2
-rw-r--r--test/ufuzz/job.js10
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);
}