test(catalog): give the Git publication tests room to finish
Gitea Actions Runner Test / test-job (push) Successful in 0s
CI / check (push) Failing after 22s
CI / tests-unit (push) Skipped
CI / tests-integration (push) Skipped
CI / tests-ui (push) Skipped
CI / preflight (push) Skipped
CI / deploy (push) Skipped

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.
This commit is contained in:
openhands committed 2026-09-27 19:20:44 +02:00
1 parent d9ef7f8360
commit c2981bd970
1 file changed
+12 -3
+12 -3
View File
@@ -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);
});