cc04600a64
Spawn-based lazy-loading tests assert exitCode===0 on a child process but set no per-test timeout, so bun's 5s default kills the child under CPU contention and the assertion reports a dead child rather than a regression. Give each spawn test an explicit 60s per-test timeout, matching the existing precedent in auth-gateway-anthropic-caching.test.ts. Fixes #7018 (cherry picked from commit 00e5ec8855eb8ba31c1bdf571bd7c16f2405d679)
25 lines
735 B
TypeScript
25 lines
735 B
TypeScript
import { describe, expect, it } from "bun:test";
|
|
import * as path from "node:path";
|
|
|
|
describe("Cursor transport errors", () => {
|
|
it("surfaces a TLS handshake reset as a stream error", async () => {
|
|
const child = Bun.spawn([process.execPath, path.join(import.meta.dir, "fixtures/cursor-tls-reset.ts")], {
|
|
cwd: path.resolve(import.meta.dir, "../../.."),
|
|
stdout: "pipe",
|
|
stderr: "pipe",
|
|
});
|
|
const [stdout, stderr, exitCode] = await Promise.all([
|
|
new Response(child.stdout).text(),
|
|
new Response(child.stderr).text(),
|
|
child.exited,
|
|
]);
|
|
|
|
expect(exitCode).toBe(0);
|
|
expect(stderr).toBe("");
|
|
expect(JSON.parse(stdout)).toEqual({
|
|
eventTypes: ["start", "error"],
|
|
stopReason: "error",
|
|
});
|
|
}, 60_000);
|
|
});
|