Public: anyone can read this; the crew can change it.

The Talk phone fixture is each file's own, so two Talk files in one --no-isolate worker both get a server and a browser #17556

opened this

Merged 20h 35m ago, live in production

fix/talk-phone-no-isolate → main 0 commits 1 thread · 1 unresolved

  • Merged. fix/talk-phone-no-isolate was merged into main as 7aa9045.

Review

Sign in to review this change.
2 files changed +15 −1
test/helpers/talk-phone.ts +12
@@ -72,6 +72,14 @@ const toolTurns = (userId: string, id: string, n: number): void => {
7272 const TABLE =
7373 "| Pull | What it does |\n|---|---|\n| #16552 | `a-very-long-identifier-that-never-wraps-anywhere-on-a-phone` and more words |\n| #16561 | Earlier keeps the place |";
7474
75 /**
76 * The fixture, registered by each file that uses it (`widthTests`, and talk-phone.test.ts by name):
77 * hooks at this module's top level ran only for the first file of a process. Under `bun test
78 * --no-isolate` (the check's parallel mode, #17537) the files of one worker share this module, so a
79 * second file got no fixture of its own: the first file's server stopped and its browser closed,
80 * and every page waited out "Target.createBrowserContext" (35 reds on #17213, 2026-12-02).
81 */
82 export function talkPhoneFixture(): void {

Nit: indent the hooks that follow, up to the closing brace, by two spaces so they read as the function's body.

7583 beforeAll(async () => {
7684 dir = await mkdtemp(join(tmpdir(), "forge-talk-phone-"));
7785 app = createApp({ dataDir: dir, port: 0 });
@@ -145,10 +153,13 @@ beforeAll(async () => {
145153 }, 30_000);
146154 afterAll(async () => {
147155 await browser?.close();
156 // The next file in this process starts its own.
157 browser = undefined;
148158 servers.stop();
149159 app.close();
150160 await rm(dir, { recursive: true, force: true });
151161 });
162 }
152163
153164 export const phone = (
154165 width: number,
@@ -174,6 +185,7 @@ export const IDS =
174185
175186 /** The browser tests of one width. */
176187 export function widthTests(width: (typeof WIDTHS)[number]): void {
188 talkPhoneFixture();
177189 test.skipIf(skip)(
178190 `${width} px: the message box does not ride when the status line speaks, nor with the tool-call count`,
179191 async () => {
test/talk-phone.test.ts +3 −1
@@ -18,7 +18,9 @@
1818 import { expect, test } from "bun:test";
1919 import { appendTurn, listTurns } from "../src/core/conversations.ts";
2020 import { clock } from "../src/web/pages/talk.ts";
21 import { IDS, WAIT, aliceId, app, listToken, longId, phone, servers, shortId, skip, token } from "./helpers/talk-phone.ts";
21 import { IDS, WAIT, aliceId, app, listToken, longId, phone, servers, shortId, skip, talkPhoneFixture, token } from "./helpers/talk-phone.ts";
22
23 talkPhoneFixture();
2224
2325 test("without a browser: the conversation's controls are in a dock beside the composer, plain links and forms, the head the title alone on a phone", async () => {
2426 const res = await fetch(`${servers.url}/talk/${shortId}`, { headers: { cookie: `forge_session=${token}` } });

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs