From c2981bd970e5900582ad8b08f7de84fdb7e23724 Mon Sep 17 00:00:00 2001 From: openhands Date: Sun, 27 Sep 2026 19:20:44 +0200 Subject: [PATCH] test(catalog): give the Git publication tests room to finish These drive real git processes against a local bare remote, so their cost is process spawns competing with every other Vitest worker. Measured on CI they take 23-30s each, and the 30s override was crossed by 37ms, so the run failed on wall-clock rather than on behaviour. Replace the three hand-picked 30_000 values with one documented constant at 120_000, which keeps a genuine hang visible while clearing the observed spread. The global default stays at 10s so nothing else is loosened. --- src/lib/services/catalog-git-release.test.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/lib/services/catalog-git-release.test.ts b/src/lib/services/catalog-git-release.test.ts index 67b42144..a651b917 100644 --- a/src/lib/services/catalog-git-release.test.ts +++ b/src/lib/services/catalog-git-release.test.ts @@ -54,6 +54,15 @@ async function fixture() { return { options, git, manifestSource, source }; } +// Each test drives real `git` processes against a local bare remote: init, +// pull --rebase, ls-files --stage, push and rev-parse. That is deliberately +// real work, so the cost is process spawns competing with every other Vitest +// worker for CPU. On CI these land at 23-30s each, which is why the default +// 10s and even a hand-picked 30s are too tight; the first case measures two +// publications to prove identical data does not create a second commit. +// Keep the override well clear of a genuine hang. +const GIT_PUBLICATION_TIMEOUT = 120_000; + describe("catalog release Git publication", () => { it("publishes exact files and does not create another commit for identical data", async () => { const { options, git } = await fixture(); @@ -66,7 +75,7 @@ describe("catalog release Git publication", () => { "utf8", ), ).toBe("asset\r\n"); - }, 30_000); + }, GIT_PUBLICATION_TIMEOUT); it("rejects a snapshot changed after manifest creation and restores a clean checkout", async () => { const { options, source, git } = await fixture(); const head = git("rev-parse", "HEAD"); @@ -76,7 +85,7 @@ describe("catalog release Git publication", () => { ); expect(git("rev-parse", "HEAD")).toBe(head); expect(git("status", "--porcelain")).toBe(""); - }, 30_000); + }, GIT_PUBLICATION_TIMEOUT); it("rejects Git newline normalization before creating a commit", async () => { const { options, git } = await fixture(); await writeFile( @@ -92,5 +101,5 @@ describe("catalog release Git publication", () => { ); expect(git("rev-parse", "HEAD")).toBe(head); expect(git("status", "--porcelain")).toBe(""); - }, 30_000); + }, GIT_PUBLICATION_TIMEOUT); });