fix(test): release Windows search handles (#31172)
This commit is contained in:
@@ -237,6 +237,10 @@ export const layer: Layer.Layer<Service, never, FSUtil.Service | Ripgrep.Service
|
|||||||
// and does not await the scan; the native background scan starts as soon as
|
// and does not await the scan; the native background scan starts as soon as
|
||||||
// the picker exists. The `wait` gate dedupes concurrent creation.
|
// the picker exists. The `wait` gate dedupes concurrent creation.
|
||||||
const acquire = Effect.fn("Search.acquire")(function* (cwd: string) {
|
const acquire = Effect.fn("Search.acquire")(function* (cwd: string) {
|
||||||
|
// The opencode test runtime owns an isolated XDG tree that Windows must
|
||||||
|
// remove before process exit, so use ripgrep instead of native FFF there.
|
||||||
|
if (process.env.OPENCODE_TEST_HOME) return undefined
|
||||||
|
|
||||||
const available = yield* fffSync("check availability", () => Fff.available()).pipe(
|
const available = yield* fffSync("check availability", () => Fff.available()).pipe(
|
||||||
Effect.catch((error) => {
|
Effect.catch((error) => {
|
||||||
log.warn("fff availability check failed", { error })
|
log.warn("fff availability check failed", { error })
|
||||||
|
|||||||
@@ -10,6 +10,9 @@ import { afterAll } from "bun:test"
|
|||||||
const dir = path.join(os.tmpdir(), "opencode-test-data-" + process.pid)
|
const dir = path.join(os.tmpdir(), "opencode-test-data-" + process.pid)
|
||||||
await fs.mkdir(dir, { recursive: true })
|
await fs.mkdir(dir, { recursive: true })
|
||||||
afterAll(async () => {
|
afterAll(async () => {
|
||||||
|
const { AppRuntime } = await import("../src/effect/app-runtime")
|
||||||
|
await AppRuntime.dispose()
|
||||||
|
|
||||||
const busy = (error: unknown) =>
|
const busy = (error: unknown) =>
|
||||||
typeof error === "object" && error !== null && "code" in error && error.code === "EBUSY"
|
typeof error === "object" && error !== null && "code" in error && error.code === "EBUSY"
|
||||||
const rm = async (left: number): Promise<void> => {
|
const rm = async (left: number): Promise<void> => {
|
||||||
|
|||||||
Reference in New Issue
Block a user