Repository navigation
Conversation
…lel execution The monolithic ui-regression.ts (207-217s) was the bottleneck of the browser test lane. This change splits it into 5 independent scripts (~40-55s each): - ui-regression-palette.ts: Palette navigation, IME handling, agent status, sidebar agents - ui-regression-terminal.ts: Terminal input, paste, shortcuts, IME, touch input - ui-regression-settings.ts: Settings, sidebar, alerts, updates, feature checks - ui-regression-session.ts: Pending protocol, queue, session creation, worktree, tabs - ui-regression-mobile.ts: Mobile viewport, prompts, suggestions, close/recovery, token gate Shared setup/helpers are extracted to ui-regression-shared.ts. CI workflow is updated: - browser-main → browser-shard-1 (runs the 5 split scripts with 2 workers) - browser-other → browser-shard-2 (runs all other scripts with 4 workers) - Integration and browser aggregate job updated to depend on new shard names Expected improvement: browser lane from ~210-220s to ~90-120s at 4 workers. Co-authored-by: Hako <[email protected]>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
- Add "PASS Send now on a server-owned pending message drops Claude's suggestion" to ui-regression-session.ts (was missing from the split) - Delete original scripts/ui-regression.ts (all 38 assertions now in split scripts) - Update references in docs and scripts to point to the split scripts - Remove obsolete ui-regression.ts from ci-browser-parallel.ts evidence disable list Coverage parity: 38/38 assertions preserved across 5 split scripts. Co-authored-by: Hako <[email protected]>
- Add .catch() to route.continue() in ui-regression-mobile.ts to handle race where route is already handled - Add waitFor() before worktree-workspace-label assertion in ui-regression-session.ts to ensure element is present Co-authored-by: Hako <[email protected]>
The until() pattern with textContent() works better than waitFor() for elements that may not be immediately visible. Co-authored-by: Hako <[email protected]>
cursor
Bot
force-pushed
the
cursor/split-ui-regression-da36
branch
from
October 11, 2026 11:58
5d93e4b to
84ca12a
Compare
devswha
added a commit
that referenced
this pull request
Oct 11, 2026
## Change `scripts/ui-regression.ts` could fail with every check passing. On #824 the first CI attempt ended with ``` 451 | await route.fulfill({ response, json: body }); error: fulfill: Route is already handled! ``` after the check that owns that route had printed PASS; a rerun of the same commit passed. The handlers in question await `route.fetch()` before they answer, and the app polls `/api/machines` on its own, so a call can be in flight whenever a check ends. `page.unroute` does not wait for it. When the route taken away is the page's last one, Playwright drops the page's interceptor and continues the request on the server side; the handler's own `fulfill` then finds the route handled. The rejection travels through Playwright's event listener, outside every assertion, and Bun exits 1. `scripts/drained-route.ts` adds `routeDrained(page, url, handler)`: it registers the route and returns an unroute that first waits for the calls in flight (15 s deadline), then removes that handler. It is used at: - `ui-regression.ts`: the held stale poll, the BG status check, and the plan check on the desktop page and on the phone (its context is closed right after). - `tab-menu-regression.ts`: the pending-selection check, which unrouted first and waited for its handlers afterwards. Not used, on purpose: `unrouteAll({ behavior: "wait" })` has the same race between two calls in flight (playwright-core 1.63) and removes unrelated routes; `"ignoreErrors"` and a `.catch(() => {})` would hide a handler's real failure. A handler that throws still fails the unroute here. Left alone: `tab-menu-regression.ts:292` and `terminal-copy-regression.ts:176` only race in a failure's cleanup, and five scripts close a context with a fetched route registered (a different error, if any). #806 moves the `ui-regression.ts` sites into `ui-regression-palette.ts`; it needs this carried over when it is rebased. ## Validation - Reproduction (throwaway script, local Chrome): two requests in flight, then `page.unroute` → `fulfill: Route is already handled!` twice as unhandled rejections; the same with `routeDrained` → both fulfilled, no rejection; a handler that throws → the unroute rejects with that error. - `TMPDIR=/tmp CHROME_PATH=<lockfile Chromium> bun run check run --build bun scripts/ui-regression.ts`: exit 0, 115 PASS lines, on an isolated herdr (this includes `checkTabMenu`). - `bun run typecheck`: passed. - The diagnosis and the fix were reviewed read-only against playwright-core's source (`Route.removeHandler` continuing the request, `_startHandling`'s assertion). The original failure is rare (one of the last 26 failed CI runs), so a passing run does not prove its absence; the reproduction is what shows the race gone. ## Release Test scripts only; no app, contract or runtime change.
Owner
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change
The monolithic
ui-regression.ts(207-217s) was the serial bottleneck of the browser test lane—more workers couldn't help because it ran as one sequential script.This PR splits it into 5 independent scripts (~40-55s each) that can run in parallel:
ui-regression-palette.tsui-regression-terminal.tsui-regression-settings.tsui-regression-session.tsui-regression-mobile.tsShared setup/helpers are extracted to
ui-regression-shared.ts:createTestSession()/closeTestSession()- Session lifecyclecreateDesktopPage()/createMobilePage()- Browser contextscreateWsTracker()- WebSocket message trackinguntil,selectPane,reportAgent, etc.)CI Changes
The browser lane is restructured:
browser-main→browser-shard-1: Runs the 5 split scripts with 2 workersbrowser-other→browser-shard-2: Runs all other scripts with 4 workersIntegration and browseraggregate job updated to depend on new shard namesExpected Improvement
Based on the research data (run2 measurements on 32-core Linux PC):
The original
ui-regression.tshas been deleted since all 38 PASS assertions are now covered in the split scripts.Coverage Parity Mapping
All 38 PASS assertions from the original
ui-regression.tsare now covered exactly once across the 5 split scripts:ui-regression-palette.ts (5 assertions)
ui-regression-terminal.ts (4 assertions)
ui-regression-settings.ts (7 assertions)
ui-regression-session.ts (14 assertions)
ui-regression-mobile.ts (8 assertions)
Verification: 5 + 4 + 7 + 14 + 8 = 38 assertions (100% parity, no duplicates)
Validation
bun run typecheckpassesbun run test:unit)References research data from test-speed-research.md and gpt-6-astra.md recommendations.