test(core): stabilize Windows live I/O fixtures (#45595)

This commit is contained in:
Kit Langton 2026-08-27 14:45:07 -04:00 committed by GitHub
parent 4112698e72
commit b738ef970d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 2 deletions

View file

@ -1,4 +1,4 @@
import { describe, expect } from "bun:test"
import { describe, expect, setDefaultTimeout } from "bun:test"
import fs from "fs/promises"
import path from "path"
import { pathToFileURL } from "url"
@ -14,6 +14,9 @@ import { testEffect } from "./lib/effect"
const it = testEffect(Layer.empty)
// Cold Git setup and cloning can exceed Bun's five-second default on Windows.
setDefaultTimeout(15_000)
describe("RepositoryCache", () => {
it.live("replaces a stale cache directory before cloning", () =>
withRemote((fixture) =>

View file

@ -1,9 +1,10 @@
import { describe, expect } from "bun:test"
import { describe, expect, setDefaultTimeout } from "bun:test"
import path from "path"
import { Deferred, Effect, Fiber, Stream } from "effect"
import { Bus } from "@opencode-ai/core/bus"
import { Database } from "@opencode-ai/core/database/database"
import { AppNodeBuilder } from "@opencode-ai/core/effect/app-node-builder"
import { Watcher } from "@opencode-ai/core/filesystem/watcher"
import { LocationServiceMap } from "@opencode-ai/core/location-service-map"
import { PluginHooks } from "@opencode-ai/core/plugin/hooks"
import { PluginRuntime } from "@opencode-ai/core/plugin/runtime"
@ -22,6 +23,9 @@ import { tempGlobalLayer } from "./fixture/global"
import { tmpdir } from "./fixture/tmpdir"
import { testEffect } from "./lib/effect"
// These tests include real Location and plugin startup, not just hook callbacks.
setDefaultTimeout(15_000)
const runtime = PluginRuntime.makeCell()
const it = testEffect(
AppNodeBuilder.build(
@ -36,6 +40,7 @@ const it = testEffect(
[
[Bus.node, Bus.configured({ persist: true })],
[Global.node, tempGlobalLayer],
[Watcher.node, Watcher.configured({ enabled: false })],
[SessionExecution.node, SessionExecution.noopLayer],
[PluginRuntime.node, PluginRuntime.layerWithCell(runtime)],
],