From d7a7256bb6b0952f486c95718cfbf460b1570a56 Mon Sep 17 00:00:00 2001 From: "opencode-agent[bot]" <219766164+opencode-agent[bot]@users.noreply.github.com> Date: Mon, 10 Aug 2026 15:25:55 -0500 Subject: [PATCH] test: stabilize Windows CI timing (#41600) Co-authored-by: Aiden Cline --- .../cli/test/acp/lifecycle.subprocess.test.ts | 4 +- packages/core/test/config/agent.test.ts | 1 + packages/core/test/config/command.test.ts | 1 + packages/core/test/tool-shell.test.ts | 45 ++++++++++--------- 4 files changed, 29 insertions(+), 22 deletions(-) diff --git a/packages/cli/test/acp/lifecycle.subprocess.test.ts b/packages/cli/test/acp/lifecycle.subprocess.test.ts index 4ae855a7f38..8db8acf99e7 100644 --- a/packages/cli/test/acp/lifecycle.subprocess.test.ts +++ b/packages/cli/test/acp/lifecycle.subprocess.test.ts @@ -11,7 +11,9 @@ import { createAcpFixture, expectOk, initialize, newSession, selectConfigOption describe("acp lifecycle subprocess", () => { test("stdin EOF exits cleanly", async () => { await using fixture = await createAcpFixture() - expect(await fixture.spawn().close()).toBe(0) + const acp = fixture.spawn() + await initialize(acp) + expect(await acp.close()).toBe(0) }, 60_000) test("close capability and close request", async () => { diff --git a/packages/core/test/config/agent.test.ts b/packages/core/test/config/agent.test.ts index dd56f82398a..73655060255 100644 --- a/packages/core/test/config/agent.test.ts +++ b/packages/core/test/config/agent.test.ts @@ -465,6 +465,7 @@ Use native v2 fields.`, }, }), ) + yield* Effect.yieldNow yield* Effect.promise(() => fs.writeFile(path.join(directory, "reviewer.md"), "Review once")) yield* configTest.emitChange({ type: "create", path: path.join(directory, "reviewer.md") }) diff --git a/packages/core/test/config/command.test.ts b/packages/core/test/config/command.test.ts index c196f6bc327..c79ce451b42 100644 --- a/packages/core/test/config/command.test.ts +++ b/packages/core/test/config/command.test.ts @@ -185,6 +185,7 @@ Review files`, }, }), ) + yield* Effect.yieldNow yield* Effect.promise(() => fs.writeFile(path.join(directory, "review.md"), "Review once")) yield* configTest.emitChange({ type: "create", path: path.join(directory, "review.md") }) yield* configTest.emitChange({ type: "update", path: path.join(directory, "review.md") }) diff --git a/packages/core/test/tool-shell.test.ts b/packages/core/test/tool-shell.test.ts index 578009ea167..195d6855d85 100644 --- a/packages/core/test/tool-shell.test.ts +++ b/packages/core/test/tool-shell.test.ts @@ -286,27 +286,30 @@ describe("ShellTool", () => { ), ) - it.live("permissions compound commands separately", () => - Effect.acquireUseRelease( - Effect.promise(() => tmpdir()), - (tmp) => { - reset() - return withSession(tmp.path, (registry) => - executeTool(registry, call({ command: "printf one && printf two" }, "call-compound")), - ).pipe( - Effect.andThen( - Effect.sync(() => { - expect(assertions).toHaveLength(1) - expect(assertions[0]).toMatchObject({ - resources: ["printf one", "printf two"], - save: ["printf *", "printf *"], - }) - }), - ), - ) - }, - (tmp) => Effect.promise(() => tmp[Symbol.asyncDispose]().then(() => undefined)), - ), + it.live( + "permissions compound commands separately", + () => + Effect.acquireUseRelease( + Effect.promise(() => tmpdir()), + (tmp) => { + reset() + return withSession(tmp.path, (registry) => + executeTool(registry, call({ command: "printf one && printf two" }, "call-compound")), + ).pipe( + Effect.andThen( + Effect.sync(() => { + expect(assertions).toHaveLength(1) + expect(assertions[0]).toMatchObject({ + resources: ["printf one", "printf two"], + save: ["printf *", "printf *"], + }) + }), + ), + ) + }, + (tmp) => Effect.promise(() => tmp[Symbol.asyncDispose]().then(() => undefined)), + ), + { timeout: 15_000 }, ) it.live(