fix(ci): kill wedged checkout fetches

This commit is contained in:
Vincent Koc
2026-05-26 19:29:40 +02:00
parent 9fd8158c06
commit c867ecb136
5 changed files with 35 additions and 12 deletions

View File

@@ -2,6 +2,28 @@ import { readFileSync } from "node:fs";
import { describe, expect, it } from "vitest";
describe("ci workflow guards", () => {
it("kills timed manual checkout fetches after the grace period", () => {
const workflowPaths = [
".github/workflows/ci.yml",
".github/workflows/ci-check-testbox.yml",
".github/workflows/ci-build-artifacts-testbox.yml",
];
for (const workflowPath of workflowPaths) {
const workflow = readFileSync(workflowPath, "utf8");
const fetchTimeouts = workflow.match(
/timeout --signal=TERM[^\n]* 30s git -C "\$workdir"/g,
);
expect(fetchTimeouts?.length, workflowPath).toBeGreaterThan(0);
expect(fetchTimeouts, workflowPath).toEqual(
fetchTimeouts?.map(
() => 'timeout --signal=TERM --kill-after=10s 30s git -C "$workdir"',
),
);
}
});
it("runs dependency policy guards in PR CI preflight", () => {
const workflow = readFileSync(".github/workflows/ci.yml", "utf8");
const preflightGuards = workflow.slice(