From dc3ce1e1bb5a5750e00b21d0b8f76898578a4e0e Mon Sep 17 00:00:00 2001 From: Rhuan Barreto Date: Tue, 24 Mar 2026 10:38:59 +0100 Subject: [PATCH] fix: avoid Windows CI timeout in init idempotency test The test spawned two `bun run` subprocesses sequentially, each cold-starting Bun + TS compilation (~3.5s on Windows), exceeding the default 5000ms timeout. Use `initProject()` directly for setup and only spawn a subprocess for the actual idempotency assertion. --- tests/integration/init.test.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/integration/init.test.ts b/tests/integration/init.test.ts index 5098aa17..1a3ae6f1 100644 --- a/tests/integration/init.test.ts +++ b/tests/integration/init.test.ts @@ -2,6 +2,7 @@ import { describe, expect, test, beforeEach, afterEach } from "bun:test"; import { existsSync, mkdirSync, readdirSync, writeFileSync } from "node:fs"; import { join } from "node:path"; +import { initProject } from "../../src/helpers/init-project"; import { safeRmSync } from "../test-utils"; import { runCli, createTempProject } from "./cli-harness"; @@ -80,11 +81,13 @@ describe("init integration", () => { }); test("init is idempotent — second run succeeds and does not duplicate example ADR", async () => { - await runCli(["init", "--editor", "claude"], tempDir, isolatedEnv()); + // First init via direct call (avoids a second subprocess cold-start on Windows CI) + await initProject(tempDir, { editor: "claude" }); const adrsDir = join(tempDir, ".archgate", "adrs"); const adrsBefore = readdirSync(adrsDir).filter((f) => f.endsWith(".md")); + // Second init via CLI — the actual idempotency assertion const result = await runCli( ["init", "--editor", "claude"], tempDir,