Skip to content

Commit f494403

Browse files
authored
test(audio): give the non-readiness cases an isolation budget (#6682)
"native open and non-readiness events cannot claim readiness" shortened the product's 15 s ready timeout to 20 ms. The timer starts before the socket opens, so on a loaded runner it fired before the client sent session.update, and the expected [session.update, session.close] came back empty (macOS control, run 37457452698). Use isolationBudgetMs, the helper for exactly this: 20 ms locally, a 5 s floor under CI or the full suite.
1 parent 87e6dc0 commit f494403

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎tests/cli/cli-access-audio-live.test.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { afterEach, beforeEach, describe, expect, spyOn, test } from "bun:test";
33
import { Readable } from "node:stream";
44
import { handleAccessAudioCommand, type AccessAudioDeps } from "../../src/cli/access-audio";
55
import { resolveAudioClient } from "../../src/server/audio-client";
6+
import { isolationBudgetMs } from "../helpers/ci-watchdog";
67
import type { OcxConfig } from "../../src/types";
78

89
const KEY = "ocx_data_audio_live_synthetic";
@@ -125,7 +126,9 @@ describe("live audio readiness and bounded closure", () => {
125126
{ type: "session.started", session: { id: " " } },
126127
])("native open and non-readiness events cannot claim readiness", async frame => {
127128
const f = fixture([JSON.stringify(frame)]);
128-
expect(await handleAccessAudioCommand(argv, deps(f.server.port!, { audioReadyTimeoutMs: 20 }))).toBe(1);
129+
// The ready timer starts before the socket opens; a 20 ms budget can expire before the
130+
// client sends session.update on a loaded runner (macOS control, run 37457452698).
131+
expect(await handleAccessAudioCommand(argv, deps(f.server.port!, { audioReadyTimeoutMs: isolationBudgetMs(20) }))).toBe(1);
129132
expect(JSON.parse(output())).toMatchObject({ ready: false });
130133
await f.closeObserved;
131134
expect(f.messages.map((m: unknown) => (m as { type: string }).type)).toEqual(["session.update", "session.close"]);

0 commit comments

Comments
 (0)