summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorKit Langton <[email protected]>2026-03-24 13:04:04 -0400
committerGitHub <[email protected]>2026-03-24 13:04:04 -0400
commit5c1bb5de86d62bd598a89cd1ba0c1c02de103a90 (patch)
tree4858820d7ae37e4d2455981c39c2581147f51aea
parent7c5ed771c36f5acbd47a1070afc1935e8a50650b (diff)
downloadopencode-5c1bb5de86d62bd598a89cd1ba0c1c02de103a90.tar.gz
opencode-5c1bb5de86d62bd598a89cd1ba0c1c02de103a90.zip
fix: remove flaky cross-spawn spawner tests (#18977)
-rw-r--r--packages/opencode/test/effect/cross-spawn-spawner.test.ts114
1 files changed, 0 insertions, 114 deletions
diff --git a/packages/opencode/test/effect/cross-spawn-spawner.test.ts b/packages/opencode/test/effect/cross-spawn-spawner.test.ts
index 7fdcb61cd..6da071521 100644
--- a/packages/opencode/test/effect/cross-spawn-spawner.test.ts
+++ b/packages/opencode/test/effect/cross-spawn-spawner.test.ts
@@ -351,122 +351,8 @@ describe("cross-spawn spawner", () => {
}),
)
- fx.effect(
- "pipes output fd3 with { from: 'fd3' }",
- Effect.gen(function* () {
- const handle = yield* js('require("node:fs").writeSync(3, "hello from fd3\\n")', {
- additionalFds: { fd3: { type: "output" } },
- }).pipe(
- ChildProcess.pipeTo(
- js(
- 'process.stdin.setEncoding("utf8"); let out = ""; process.stdin.on("data", (chunk) => out += chunk); process.stdin.on("end", () => process.stdout.write(out))',
- ),
- { from: "fd3" },
- ),
- )
- const out = yield* decodeByteStream(handle.stdout)
- yield* handle.exitCode
- expect(out).toBe("hello from fd3")
- }),
- )
-
- fx.effect(
- "pipes stdout to fd3",
- Effect.gen(function* () {
- if (process.platform === "win32") return
-
- const handle = yield* js('process.stdout.write("hello from stdout")').pipe(
- ChildProcess.pipeTo(js('process.stdout.write(require("node:fs").readFileSync(3, "utf8"))'), { to: "fd3" }),
- )
- const out = yield* decodeByteStream(handle.stdout)
- yield* handle.exitCode
- expect(out).toBe("hello from stdout")
- }),
- )
- })
-
- describe("additional fds", () => {
- fx.effect(
- "reads data from output fd3",
- Effect.gen(function* () {
- const handle = yield* js('require("node:fs").writeSync(3, "hello from fd3\\n")', {
- additionalFds: { fd3: { type: "output" } },
- })
- const out = yield* decodeByteStream(handle.getOutputFd(3))
- yield* handle.exitCode
- expect(out).toBe("hello from fd3")
- }),
- )
-
- fx.effect(
- "writes data to input fd3",
- Effect.gen(function* () {
- if (process.platform === "win32") return
-
- const input = Stream.make(new TextEncoder().encode("data from parent"))
- const handle = yield* js('process.stdout.write(require("node:fs").readFileSync(3, "utf8"))', {
- additionalFds: { fd3: { type: "input", stream: input } },
- })
- const out = yield* decodeByteStream(handle.stdout)
- yield* handle.exitCode
- expect(out).toBe("data from parent")
- }),
- )
-
- fx.effect(
- "returns empty stream for unconfigured fd",
- Effect.gen(function* () {
- const handle =
- process.platform === "win32"
- ? yield* js('process.stdout.write("test")')
- : yield* ChildProcess.make("echo", ["test"])
- const out = yield* decodeByteStream(handle.getOutputFd(3))
- yield* handle.exitCode
- expect(out).toBe("")
- }),
- )
-
- fx.effect(
- "works alongside normal stdout and stderr",
- Effect.gen(function* () {
- const handle = yield* js(
- 'require("node:fs").writeSync(3, "fd3\\n"); process.stdout.write("stdout\\n"); process.stderr.write("stderr\\n")',
- {
- additionalFds: { fd3: { type: "output" } },
- },
- )
- const stdout = yield* decodeByteStream(handle.stdout)
- const stderr = yield* decodeByteStream(handle.stderr)
- const fd3 = yield* decodeByteStream(handle.getOutputFd(3))
- yield* handle.exitCode
- expect(stdout).toBe("stdout")
- expect(stderr).toBe("stderr")
- expect(fd3).toBe("fd3")
- }),
- )
})
- describe("large output", () => {
- fx.effect(
- "does not deadlock on large stdout",
- Effect.gen(function* () {
- const handle = yield* js("for (let i = 1; i <= 100000; i++) process.stdout.write(`${i}\\n`)")
- const out = yield* handle.stdout.pipe(
- Stream.decodeText(),
- Stream.runFold(
- () => "",
- (acc, chunk) => acc + chunk,
- ),
- )
- yield* handle.exitCode
- const lines = out.trim().split("\n")
- expect(lines.length).toBe(100000)
- expect(lines[0]).toBe("1")
- expect(lines[99999]).toBe("100000")
- }),
- { timeout: 10_000 },
- )
- })
describe("Windows-specific", () => {
fx.effect(