Repository navigation
test(vite-plugin): fix webkit operation-completion poll flake - #1240
Merged
trueadm merged 1 commit intoSep 22, 2026
Merged
Conversation
The two polls that wait for a generator's terminal `Completed: …` yield relied on the default 1s expect.poll timeout. The fixture's host sleeps 600ms between the first and last yield, so the budget only covers that sleep plus one RPC round trip, and WebKit in CI intermittently exceeds it. Both waits now allow 10s, matching the explicit timeouts already used for slow browser polls elsewhere in the suite.
10 tasks
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.
The
heavy integrationlane fails intermittently on this case, most recently on the CI run for #1237, which changes only release scripts and cannot affect it:Why these two polls
Both waits poll for the terminal yield of a conversation operation:
Neither passes a
timeout, so each gets Vitest's defaultexpect.pollbudget, which is{ interval: 50, timeout: 1000 }.These are the only polls in the test that wait on work gated behind a deliberate server-side delay. The fixture host in
tests/_fixtures/app/src/conversation/host.tsyieldsWorking on …, sleeps 600ms, and only then yieldsCompleted: …. Every other poll in the test waits on state that lands without that delay, which is consistent with the failure concentrating here.I have not instrumented how much of the 600ms is still outstanding by the time the poll starts: the preceding conversation switches consume some of it, and the exact residual depends on runner speed. So the honest statement is that these two assertions have the least headroom in the test and a 1000ms budget is too tight for WebKit on a loaded CI runner, not that the full sleep sits inside the poll window.
I also checked the obvious alternative, a lost update when the test switches from conversation B back to A. The
watchgenerator in_fixtures/app/src/conversation/operations.tsre-comparessource.frame.revisionat the top of each iteration before awaiting, so a publish that lands during re-subscription is still observed on the next pass. I found no dropped-frame path, which points at latency rather than a correctness bug.Change
Give both completion polls a 10s timeout, matching the explicit timeouts already used for slow browser polls elsewhere in the suite, for example
{ timeout: 10_000 }inpackages/vite-plugin-octane/tests/browser/hmr.test.tsandpackages/monaco-editor/tests/browser/editor.browser.test.ts.The second poll (
Completed: history-4, the webkit fetched-SSR case) has the identical shape and the same thin margin, so it gets the same treatment rather than waiting for it to go red on its own.No
itordescribetimeout changes, and no assertion is weakened: the test still requires exactly one matching node. Only the time allowed to observe it changes, so a genuine regression that never yieldsCompleted:still fails, 9s later. Both enclosing tests already allow 60s, so the larger poll budget cannot outlive its test.Tests
Not run.
vitest run packages/vite-plugin-octane/tests/production.test.tsneeds the built workspace and Playwright browsers, which I could not provision. The change is confined to twoexpect.polloption objects;prettier --checkpasses on the file, and the{ interval?, timeout?, message? }option shape is checked againstExpectPollOptionsin vitest 4.1.10.If this still flakes at 10s, the fixture's hardcoded 600ms sleep is the next thing to attack.