Skip to content

Every WebKit browser test survives a renderer crash - #2907

Merged
davidmckayv merged 1 commit into
mainfrom
webkit-crash-retry
Dec 4, 2026
Merged

davidmckayv merged 1 commit into
mainfrom
webkit-crash-retry

Conversation

@davidmckayv

@davidmckayv davidmckayv commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

What this changes

WebKit on Linux crashes its own renderer under CI's load, and whichever test had a page open fails with "Target page, context or browser has been closed", for nothing it checks. Today that failed the 1.2.10 publish three times on sidebar-current-row.test.tsx, and it has failed a select-box layout test and other WebKit shards on pull requests.

app/tests/renderer-crash.ts already has the answer: a test that runs a test again when Playwright reports that a page's renderer crashed (up to two more goes) and fails on anything else. Only some of the browser files used it. This moves every one that runs in WebKit onto it, and adds a CI rule so a new one can't land on bun's plain test.

  • Every WebKit browser test file takes test from renderer-crash.ts. 71 files move: the rest of the WebKit job's list, connect-your-ai.test.tsx (its WebKit-only step), and every app browser test that reads OPENBOT_APP_ENGINES, which tests (changed files) runs in WebKit when it changes. The only change in each is where test is imported from; nothing else in them changes.
  • test.each survives a crash too, and test.skip and the rest work through it. The engine lists are written as test.each(...). Through the old wrapper, test.each (and test.skip, test.todo, test.only) was called on the Proxy rather than on bun's test, and bun refuses that: "Expected this to be instanceof ScopeFunctions", and the whole file fails to load. So no file using test.each could move. Now test.each bodies get the same retry, and the rest of bun's test is called on bun's own.
  • A CI rule in scripts/ci-changes.test.ts, next to the other real-browser job rules: every test file a ci.yml step runs with OPENBOT_APP_ENGINES (or OPENBOT_APP_ENGINE) set to WebKit, and every app browser test that reads OPENBOT_APP_ENGINES, must import test from renderer-crash.ts and not from bun:test. Two files are exempt, with the reason written next to them: renderer-crash.test.ts, which proves the retry by crashing a renderer and must not retry itself, and the desktop setup window's test, whose own jobs typecheck it without the root's Playwright and which runs one test in WebKit.

Real failures still fail. The retry only runs again when Playwright's own crash event fired during the test, or on WebKit's "WebKit encountered an internal error" navigation failure; anything else is the test's on that go. This PR adds a fixture case for exactly the words a crash fails with, "Target page, context or browser has been closed", from a page the test closed itself and with no crash behind it: it fails at once, on its first go.

Test-only. Nothing a deployment runs changes.

Where it runs

  • New state that outlives a request? None. Test code only.
  • What happens on the second replica? Nothing changes: no server code.
  • Anything serialised? No.
  • Anything fanned out to a browser? No.
  • New listener, port, or schedule? No.

Boundary and audit

  • Every acting call still goes through the gateway: no server code changes.
  • New refusals and new failures each write a row: none added.
  • Nothing new is trusted from the client.

API and database

  • This changes nothing under api/, no app's requests, no database change and no release-policy.json.

Changelog

None: test-only, nobody running OpenBot would notice.

Proof

The CI rule, red before, green after. On main's tree (with the rule added), bun test scripts/ci-changes.test.ts -t "takes .test. from renderer-crash" fails and lists 72 files on bun's test (the 71 moved here, plus the desktop file, since exempted). After the change: 67 pass, 0 fail.

The retry's own test (OPENBOT_APP_BROWSER=1 bun test app/tests/renderer-crash.test.ts, in a real Chromium whose chrome://crash crashes the renderer on purpose):

  • With main's renderer-crash.ts it fails: the fixture doesn't load (TypeError: Expected this to be instanceof ScopeFunctions ... ERR_INVALID_THIS at its test.each), so no test in it runs.
  • With this branch's it passes, 27 expects: a crash once passes on go 2, twice on go 3, every time fails after 3; an assertion failure fails on go 1; "Target page, context or browser has been closed" with no crash fails on go 1; another navigation failure fails on go 1; through test.each, a crash once passes on go 2 and an assertion failure fails on go 1; test.skip never runs and the file loads.

The WebKit list on CI (this PR's run): all three shards green, 0 failures. On shard 1 the renderer crashed twice in sidebar-current-row.test.tsx ("click: Target page, context or browser has been closed"); each time the test ran again and passed.

The WebKit list, locally, at two workers (this Mac is shared): 116 files in Chromium and WebKit. The run was cut short when the branch's worktree was removed after the merge, so its last files failed for missing files (ENOENT). It is not a clean local result.

Checks: biome lint --error-on-warnings . and biome format . clean; bun run --cwd app typecheck clean.

No screen changes, so there are no screenshots.

WebKit on Linux crashes its own renderer under CI's load, and the test that had a page open fails
with "Target page, context or browser has been closed" for nothing it checks. It failed the 1.2.10
publish three times and WebKit shards on pull requests. Every test file that runs in WebKit now
takes `test` from renderer-crash.ts, which runs a test again only when Playwright reported a
renderer crash in it, and a CI rule fails a WebKit file left on bun's own `test`.

renderer-crash.ts's `test.each` now gets the retry too, and `test.skip` and the rest of bun's
`test` are called on bun's own: called on the Proxy, bun refused them and the file failed to load.
@davidmckayv
davidmckayv marked this pull request as ready for review December 3, 2026 23:35
@davidmckayv
davidmckayv merged commit 887e6d9 into main Dec 4, 2026
26 checks passed
@davidmckayv
davidmckayv deleted the webkit-crash-retry branch December 4, 2026 00:31
davidmckayv added a commit that referenced this pull request Dec 4, 2026
sittichart17 pushed a commit to sittichart17/OpenBot that referenced this pull request Dec 4, 2026
…t#2904)

* Re-land Boundaries on Cedar (CopilotKit#2880) after 1.2.10

CopilotKit#2880 was reverted in the 1.2.10 release PR (CopilotKit#2903) because it merged during the freeze and its server half (openbot-backend CopilotKit#1139) wasn't in the 1.2.10 images. CopilotKit#1139 is now on backend main, so this brings the app half back unchanged, with release-policy.json at 0219_action_policy_rules.

* Boundaries layout test takes test from renderer-crash.ts, as every WebKit test does (CopilotKit#2907)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant