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
Merged 20h 35m ago, live in production
fix/talk-phone-no-isolate → main 0 commits 1 thread · 1 unresolved
2 files
changed +15
−1
test/helpers/talk-phone.ts +12
| @@ -72,6 +72,14 @@ const toolTurns = (userId: string, id: string, n: number): void => { | ||
| 72 | 72 | const TABLE = |
| 73 | 73 | "| 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 |"; |
| 74 | 74 | |
| 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 { | |
| 75 | 83 | beforeAll(async () => { |
| 76 | 84 | dir = await mkdtemp(join(tmpdir(), "forge-talk-phone-")); |
| 77 | 85 | app = createApp({ dataDir: dir, port: 0 }); |
| @@ -145,10 +153,13 @@ beforeAll(async () => { | ||
| 145 | 153 | }, 30_000); |
| 146 | 154 | afterAll(async () => { |
| 147 | 155 | await browser?.close(); |
| 156 | // The next file in this process starts its own. | |
| 157 | browser = undefined; | |
| 148 | 158 | servers.stop(); |
| 149 | 159 | app.close(); |
| 150 | 160 | await rm(dir, { recursive: true, force: true }); |
| 151 | 161 | }); |
| 162 | } | |
| 152 | 163 | |
| 153 | 164 | export const phone = ( |
| 154 | 165 | width: number, |
| @@ -174,6 +185,7 @@ export const IDS = | ||
| 174 | 185 | |
| 175 | 186 | /** The browser tests of one width. */ |
| 176 | 187 | export function widthTests(width: (typeof WIDTHS)[number]): void { |
| 188 | talkPhoneFixture(); | |
| 177 | 189 | test.skipIf(skip)( |
| 178 | 190 | `${width} px: the message box does not ride when the status line speaks, nor with the tool-call count`, |
| 179 | 191 | async () => { |
test/talk-phone.test.ts +3 −1
| @@ -18,7 +18,9 @@ | ||
| 18 | 18 | import { expect, test } from "bun:test"; |
| 19 | 19 | import { appendTurn, listTurns } from "../src/core/conversations.ts"; |
| 20 | 20 | 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(); | |
| 22 | 24 | |
| 23 | 25 | 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 () => { |
| 24 | 26 | const res = await fetch(`${servers.url}/talk/${shortId}`, { headers: { cookie: `forge_session=${token}` } }); |
new above
offline
Nit: indent the hooks that follow, up to the closing brace, by two spaces so they read as the function's body.