Skip to content

Commit 8b84250

Browse files
sheehanmunimclaude
andcommitted
test(server): ACP teardown tests pass on Windows hosts
Fixes #17011. Two AcpAdapterV2 tests fake processGroupPlatform "win32" but still depend on the real host platform, so they fail on Windows. "Windows teardown is one-shot explicitly with independent finalizer cleanup": the runtime's scope finalizer is deliberately independent of the cached explicit teardown and picks its kill path from HostProcessPlatform. On a Windows host it calls taskkill through the stubbed spawner a second time, so the final count is 2, not 1. On Linux it sends SIGKILL instead. The assertion now expects the finalizer's extra taskkill only on a Windows host, so Linux runs are unchanged. "poisons the session when hard teardown defects and blocks replacement work": the mock agent's running-command fixture runs `bash -c 'sleep 120 & ...'` and publishes $$/$! as host PIDs. With Git Bash those are MSYS PIDs, so process.kill(pid, 0) never sees them. With WSL's bash.exe first on PATH, the Windows temp path never receives the PID file, and the test hangs until its timeout. It now uses the same Linux-host guard as the other real-process fixture tests in this file. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 0f09627 commit 8b84250

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.test.ts‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12328,7 +12328,11 @@ describe("AcpAdapterV2", () => {
1232812328
});
1232912329
assert.equal(taskkillCommands.length, 1);
1233012330
yield* Scope.close(runtimeScope, Exit.void);
12331-
assert.equal(taskkillCommands.length, 1);
12331+
// The scope finalizer picks its kill path from the host, not processGroupPlatform,
12332+
// so only a Windows host sends it through taskkill a second time.
12333+
const finalizerTaskkills = (yield* HostProcessPlatform) === "win32" ? 1 : 0;
12334+
assert.equal(taskkillCommands.length, 1 + finalizerTaskkills);
12335+
assert.deepEqual(taskkillCommands.at(-1), taskkillCommands[0]);
1233212336
}).pipe(Effect.provide(layerTest)),
1233312337
);
1233412338

@@ -12437,6 +12441,7 @@ describe("AcpAdapterV2", () => {
1243712441

1243812442
it.live("poisons the session when hard teardown defects and blocks replacement work", () =>
1243912443
Effect.gen(function* () {
12444+
if ((yield* HostProcessPlatform) !== "linux") return;
1244012445
const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner;
1244112446
const fileSystem = yield* FileSystem.FileSystem;
1244212447
const idAllocator = yield* IdAllocator.IdAllocatorV2;

0 commit comments

Comments
 (0)