Allow CI perf gate to fall back to any task
This commit is contained in:
@@ -111,6 +111,7 @@ async function candidateTasks(url: string): Promise<CandidateTask[]> {
|
||||
...tasks.filter((task) => terminalStatus(task.status) && ((task.stepCount ?? 0) === 0 || task.stepCount === null)),
|
||||
...tasks.filter((task) => terminalStatus(task.status)),
|
||||
...tasks.filter((task) => !terminalStatus(task.status) && task.status !== "queued" && task.status !== "running" && task.status !== "judging"),
|
||||
...tasks,
|
||||
];
|
||||
const seen = new Set<string>();
|
||||
return ordered.filter((task) => {
|
||||
@@ -148,7 +149,7 @@ async function traceSeq(url: string, taskId: string, timeoutMs: number): Promise
|
||||
|
||||
async function traceTarget(url: string): Promise<{ taskId: string; skippedTaskIds: string[]; selection: JsonValue }> {
|
||||
const tasks = await candidateTasks(url);
|
||||
if (tasks.length === 0) throw new Error("Code Queue CI perf could not find a terminal task id in the production PostgreSQL task table");
|
||||
if (tasks.length === 0) throw new Error("Code Queue CI perf could not find a task id in the production PostgreSQL task table");
|
||||
const target = tasks[0];
|
||||
if (target === undefined) throw new Error("Code Queue CI perf could not select a task from the production PostgreSQL task table");
|
||||
return { taskId: target.id, skippedTaskIds: tasks.slice(1).map((task) => task.id), selection: target as unknown as JsonValue };
|
||||
|
||||
Reference in New Issue
Block a user