fix corner case in ufuzz scheduling (#4154)
This commit is contained in:
@@ -15,18 +15,17 @@ exports.should_stop = function(callback) {
|
|||||||
}).sort(function(a, b) {
|
}).sort(function(a, b) {
|
||||||
return b.run_number - a.run_number;
|
return b.run_number - a.run_number;
|
||||||
});
|
});
|
||||||
if (runs.length < 10) return;
|
|
||||||
var found = false, remaining = 20;
|
var found = false, remaining = 20;
|
||||||
(function next() {
|
(function next() {
|
||||||
if (!runs.length) return;
|
if (!runs.length) return;
|
||||||
var workflow = runs.pop();
|
var workflow = runs.pop();
|
||||||
if (workflow.run_number == run_number) found = true;
|
if (workflow.event == "schedule" && workflow.run_number == run_number) found = true;
|
||||||
read(workflow.jobs_url, function(reply) {
|
read(workflow.jobs_url, function(reply) {
|
||||||
if (!reply || !Array.isArray(reply.jobs)) return;
|
if (!reply || !Array.isArray(reply.jobs)) return;
|
||||||
if (!reply.jobs.every(function(job) {
|
if (!reply.jobs.every(function(job) {
|
||||||
if (job.status == "completed") return true;
|
if (job.status == "completed") return true;
|
||||||
remaining--;
|
remaining--;
|
||||||
return found;
|
return found || workflow.event != "schedule";
|
||||||
})) return;
|
})) return;
|
||||||
if (remaining >= 0) {
|
if (remaining >= 0) {
|
||||||
next();
|
next();
|
||||||
|
|||||||
Reference in New Issue
Block a user