Skip to content

armgit / hypit

Public Imported from GitHub
0

Clone any viral video with AI agents. Not just a script, the whole workflow: swap the face, the words, the B-roll, ship 100 variants in one command, and get your 100M views.

ci: fail a stalled test instead of holding the runner

rponea7a7e8fe95cd
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 58b33fa4..89bf3276 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -29,6 +29,10 @@ jobs:
# alike. That gap is real and older than this matrix; closing it means adding ffmpeg to both,
# not to one, which would leave a red leg ambiguous between the two causes.
runs-on: ${{ matrix.os }}
+ # A test that never returns would otherwise hold a runner until the six-hour default. The
+ # suite takes about a minute; this is the ceiling for a job that has stopped making progress,
+ # not a budget the tests are meant to approach.
+ timeout-minutes: 20
strategy:
# Breakage on one platform is a different finding from breakage on the other, and cancelling
# the second leg would throw away the half of the answer nobody has yet.
diff --git a/packages/runtime-local/test/local.test.ts b/packages/runtime-local/test/local.test.ts
index 6c187146..c73fbd80 100644
--- a/packages/runtime-local/test/local.test.ts
+++ b/packages/runtime-local/test/local.test.ts
@@ -855,10 +855,18 @@ test("one local Worker admits later Builds while preserving shared Endpoint capa
await firstStarted;
await runtime.build(durableBuildRequest(directory, "bld_20260902T120000011Z_0000000001", createGreetingBuild()));
const results = new FileBuildResultRepository(join(directory, "results"));
+ // Waiting without a deadline for an outcome that never arrives is indistinguishable from a
+ // suite that has stopped: no assertion fails and nothing further is printed. Carry the last
+ // outcomes into the failure so a Build that stalled is named rather than guessed at.
+ const ids = ["bld_20260902T120000010Z_0000000001", "bld_20260902T120000011Z_0000000001"];
+ const deadline = Date.now() + 30_000;
+ let outcomes: readonly (string | undefined)[] = [];
while (true) {
- const outcomes = await Promise.all(["bld_20260902T120000010Z_0000000001", "bld_20260902T120000011Z_0000000001"].map(async (id) =>
- (await results.read(id))?.outcome));
+ outcomes = await Promise.all(ids.map(async (id) => (await results.read(id))?.outcome));
if (outcomes.every((outcome) => outcome === "complete")) break;
+ if (Date.now() > deadline) {
+ assert.fail(`Builds did not complete within 30s: ${ids.map((id, at) => `${id} is ${outcomes[at] ?? "unwritten"}`).join(", ")}`);
+ }
await new Promise((resolve) => setTimeout(resolve, 5));
}
controller.abort();
diff --git a/test/run.mjs b/test/run.mjs
index f0bdd032..240107cd 100644
--- a/test/run.mjs
+++ b/test/run.mjs
@@ -50,7 +50,16 @@ if (suite === undefined) {
files = suite.files;
}
-const result = spawnSync(process.execPath, ["--import", "tsx", "--test", ...files], {
+/**
+ * A test that waits forever otherwise stops the whole suite without saying which one it was: the
+ * runner prints nothing more and the CI job holds its runner until the six-hour ceiling. This
+ * bound turns that into an ordinary failure naming the test.
+ */
+const testTimeoutMs = 120_000;
+
+const result = spawnSync(process.execPath, [
+ "--import", "tsx", "--test", `--test-timeout=${testTimeoutMs}`, ...files,
+], {
stdio: "inherit",
windowsHide: true,
// What the caller already chose wins: these are defaults for running the suite, not a policy.