From a718df4edffaaba089d9c086a116ef97959acfc2 Mon Sep 17 00:00:00 2001 From: Theo Browne Date: Wed, 30 Sep 2026 23:56:49 -0700 Subject: [PATCH] fix(release): Windows CLI smoke test no longer fails on temp dir cleanup Co-Authored-By: Claude Opus 5.5 (1M context) --- scripts/smoke-cli-archive.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/scripts/smoke-cli-archive.ts b/scripts/smoke-cli-archive.ts index cce14d5654f1..0af024c0ec92 100644 --- a/scripts/smoke-cli-archive.ts +++ b/scripts/smoke-cli-archive.ts @@ -15,6 +15,7 @@ import * as FileSystem from "effect/FileSystem"; import * as Layer from "effect/Layer"; import * as Logger from "effect/Logger"; import * as Path from "effect/Path"; +import * as Schedule from "effect/Schedule"; import * as Schema from "effect/Schema"; import * as Stream from "effect/Stream"; import { Command, Flag } from "effect/unstable/cli"; @@ -73,7 +74,18 @@ const smokeCliArchive = Effect.fn("smokeCliArchive")(function* (input: { const path = yield* Path.Path; const platform = yield* HostProcessPlatform; const spawner = yield* ChildProcessSpawner.ChildProcessSpawner; - const scratch = yield* fs.makeTempDirectoryScoped({ prefix: "t3-cli-smoke-" }); + const scratch = yield* fs.makeTempDirectory({ prefix: "t3-cli-smoke-" }); + // Windows can keep t3.exe locked (EBUSY) for a moment after the server + // exits. A leftover scratch directory on a CI runner is harmless, so + // cleanup retries briefly and never fails a smoke test that passed. + yield* Effect.addFinalizer(() => + fs.remove(scratch, { recursive: true }).pipe( + Effect.retry({ times: 10, schedule: Schedule.spaced("500 millis") }), + Effect.catch((error) => + Effect.logWarning(`[cli-smoke] could not remove ${scratch}: ${error.message}`), + ), + ), + ); // On Windows the archive is a zip and the Git Bash `tar` on PATH is GNU // tar; use the bsdtar Windows ships, which reads both formats.