Skip to content

Start the WebKit first-message tests after the Home intro - #2572

Closed
ykakade wants to merge 1 commit into
CopilotKit:mainfrom
ykakade:fix/2389-flaky-thinking-test
Closed

ykakade wants to merge 1 commit into
CopilotKit:mainfrom
ykakade:fix/2389-flaky-thinking-test

Conversation

@ykakade

@ykakade ykakade commented Nov 30, 2026

Copy link
Copy Markdown

What this changes

Fixes #2389
Fixes #2396

Both tests opened Home in a fresh tab. WebKit could crash while the test waited for the first-visit animation to finish, before it sent a message.

The WebKit fixture now marks the intro as played before it opens Home. The test still checks that “Thinking” appears within 200 ms and stays visible until the first words. A separate browser test covers the first-visit animation.

Where it runs

The fixture sets an existing flag in the test tab’s session storage. Each server replica handles requests as before. The change adds no shared state, serialized work, browser broadcasts, listeners, ports, or schedules.

Boundary and audit

The flag controls a browser animation. It adds no acting calls, refusals, audit events, or client data for the server to trust.

API and database

The change affects only the browser test. It leaves the API, app requests, database, and release policy unchanged.

Changelog

Deployments behave the same because only the test fixture changes.

Proof

I ran each case 20 times before and after the change. Before the change, the typed message failed 11 times and the starter task failed 7 times. After the change, all 40 runs passed without a renderer retry.

Lint, format, and type checks passed. The full test suite also has failures in tests that need Docker Compose or Helm. This machine does not have these tools.

@davidmckayv

Copy link
Copy Markdown
Contributor

Thanks for digging into these, Yash. This flake kept knocking PRs out of the merge queue on 1 Dec (#2504, #2642, #2631), so I picked it up and opened #2662, which credits this PR.

I went a different way after measuring it under CI's own load. The renderer crash this works around is now caught by renderer-crash.ts, which reruns a test whose page crashed, and there were no crash reruns in 96 runs of the file. The timing misses also happen away from Home (a starter task on a new conversation with a Bot, in WebKit) and in Chromium, which marking the intro as played wouldn't reach. The cause turned out to be where the test stopped the clock: it counted the browser's own frame after Send as the page's work. #2662 measures to the first frame or the next task, whichever comes first, and keeps the 200 ms bound.

If #2662 covers what you were after, this one can probably be closed. Happy to fold anything in if you see a case it misses.

@ykakade ykakade closed this Dec 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants