Skip to content

Commit 97c678d

Browse files
authored
fix(test): release Windows search handles (anomalyco#31172)
1 parent f2d7b1b commit 97c678d

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

packages/core/src/filesystem/search.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,10 @@ export const layer: Layer.Layer<Service, never, FSUtil.Service | Ripgrep.Service
237237
// and does not await the scan; the native background scan starts as soon as
238238
// the picker exists. The `wait` gate dedupes concurrent creation.
239239
const acquire = Effect.fn("Search.acquire")(function* (cwd: string) {
240+
// The opencode test runtime owns an isolated XDG tree that Windows must
241+
// remove before process exit, so use ripgrep instead of native FFF there.
242+
if (process.env.OPENCODE_TEST_HOME) return undefined
243+
240244
const available = yield* fffSync("check availability", () => Fff.available()).pipe(
241245
Effect.catch((error) => {
242246
log.warn("fff availability check failed", { error })

packages/opencode/test/preload.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ import { afterAll } from "bun:test"
1010
const dir = path.join(os.tmpdir(), "opencode-test-data-" + process.pid)
1111
await fs.mkdir(dir, { recursive: true })
1212
afterAll(async () => {
13+
const { AppRuntime } = await import("../src/effect/app-runtime")
14+
await AppRuntime.dispose()
15+
1316
const busy = (error: unknown) =>
1417
typeof error === "object" && error !== null && "code" in error && error.code === "EBUSY"
1518
const rm = async (left: number): Promise<void> => {

0 commit comments

Comments
 (0)