@devries-cameron20 / t3code Mirror · read-only / commits / ece461e3e8
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 22, 04:30 UTC

test(desktop): the Windows shell kill test waits for each spawn before advancing the clock (#30463)

Co-authored-by: maria-rcks <254055478+maria-rcks@users.noreply.github.com>

maria committed Nov 3, 2026 at 23:40 UTC ece461e3e8af869540707f2933898c89b61204d6
1 file changed +13 -2
apps/desktop/src/shell/DesktopShellEnvironment.test.ts
+13 -2
@@ -694,17 +694,28 @@ describe("DesktopShellEnvironment", () => {
694 it.effect("gives up on a Windows shell that survives the kill", () =>
695 Effect.gen(function* () {
696 const commands: Array<string> = [];
697 + // Both PowerShell probes spawn pwsh, time out, then spawn powershell. Each probe's timeout
698 + // is armed before its spawn runs, so waiting for the spawns keeps the clock in step.
699 + const spawned = yield* Effect.forEach([0, 1, 2, 3], () => Deferred.make<void>());
700 const fiber = yield* runShellEnvironment({
701 env: { PATH: "C:\\Windows", APPDATA: "C:\\Roaming" },
702 platform: "win32",
703 handler: () => "",
704 processSpawner: ChildProcessSpawner.make((command) => {
705 + const spawn = spawned[commands.length];
706 commands.push(command._tag === "StandardCommand" ? command.command : "");
703 - return Effect.acquireRelease(Effect.succeed(makeHungProcess()), () => Effect.never);
707 + return (spawn ? Deferred.succeed(spawn, undefined) : Effect.void).pipe(
708 + Effect.andThen(
709 + Effect.acquireRelease(Effect.succeed(makeHungProcess()), () => Effect.never),
710 + ),
711 + );
712 }),
713 }).pipe(Effect.forkChild({ startImmediately: true }));
714
707 - for (let probe = 0; probe < 4; probe++) yield* TestClock.adjust("5 seconds");
715 + yield* Effect.forEach(spawned.slice(0, 2), Deferred.await);
716 + yield* TestClock.adjust("5 seconds");
717 + yield* Effect.forEach(spawned.slice(2), Deferred.await);
718 + yield* TestClock.adjust("5 seconds");
719 yield* Fiber.join(fiber);
720 assert.deepEqual([...new Set(commands)], ["pwsh.exe", "powershell.exe"]);
721 }),