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); });