report immediate ufuzz failure from Pull Request (#4128)
This commit is contained in:
2
.github/workflows/ufuzz.yml
vendored
2
.github/workflows/ufuzz.yml
vendored
@@ -36,7 +36,7 @@ jobs:
|
|||||||
npm config set update-notifier false
|
npm config set update-notifier false
|
||||||
npm --version
|
npm --version
|
||||||
while !(npm install); do echo "'npm install' failed - retrying..."; done
|
while !(npm install); do echo "'npm install' failed - retrying..."; done
|
||||||
PERIOD=1800000
|
PERIOD=-2000
|
||||||
if [[ $CAUSE == "schedule" ]]; then
|
if [[ $CAUSE == "schedule" ]]; then
|
||||||
PERIOD=`node test/ufuzz/actions $BASE_URL $TOKEN`
|
PERIOD=`node test/ufuzz/actions $BASE_URL $TOKEN`
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -2,14 +2,16 @@ var child_process = require("child_process");
|
|||||||
|
|
||||||
var ping = 5 * 60 * 1000;
|
var ping = 5 * 60 * 1000;
|
||||||
var period = +process.argv[2];
|
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);
|
for (var i = 0; i < 2; i++) spawn(endTime);
|
||||||
|
|
||||||
function spawn(endTime) {
|
function spawn(endTime) {
|
||||||
var child = child_process.spawn("node", [
|
var args = [
|
||||||
"--max-old-space-size=2048",
|
"--max-old-space-size=2048",
|
||||||
"test/ufuzz"
|
"test/ufuzz"
|
||||||
], {
|
];
|
||||||
|
if (endTime < 0) args.push(-endTime);
|
||||||
|
var child = child_process.spawn("node", args, {
|
||||||
stdio: [ "ignore", "pipe", "pipe" ]
|
stdio: [ "ignore", "pipe", "pipe" ]
|
||||||
}).on("exit", respawn);
|
}).on("exit", respawn);
|
||||||
var stdout = "";
|
var stdout = "";
|
||||||
@@ -23,6 +25,7 @@ function spawn(endTime) {
|
|||||||
console.log(stdout.slice(stdout.lastIndexOf("\r", end - 1) + 1, end));
|
console.log(stdout.slice(stdout.lastIndexOf("\r", end - 1) + 1, end));
|
||||||
stdout = stdout.slice(end + 1);
|
stdout = stdout.slice(end + 1);
|
||||||
}, ping);
|
}, ping);
|
||||||
|
if (endTime < 0) return;
|
||||||
var timer = setTimeout(function() {
|
var timer = setTimeout(function() {
|
||||||
clearInterval(keepAlive);
|
clearInterval(keepAlive);
|
||||||
child.removeListener("exit", respawn);
|
child.removeListener("exit", respawn);
|
||||||
@@ -32,6 +35,7 @@ function spawn(endTime) {
|
|||||||
function respawn() {
|
function respawn() {
|
||||||
console.log(stdout.replace(/[^\r\n]*\r/g, ""));
|
console.log(stdout.replace(/[^\r\n]*\r/g, ""));
|
||||||
clearInterval(keepAlive);
|
clearInterval(keepAlive);
|
||||||
|
if (endTime < 0) return;
|
||||||
clearTimeout(timer);
|
clearTimeout(timer);
|
||||||
spawn(endTime);
|
spawn(endTime);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user