Repository navigation
test(desktop): settle the prompt rail across two consecutive reads #4685
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
009fd2c
test(desktop): settle the prompt rail across painted frames (#4675)
Adarsh-Me d4c6677
test(desktop): gate the prompt rail on painted-frame quiescence (#4675)
Adarsh-Me ab2484d
test(desktop): pass the rail settle loop as a function, not source (#…
Adarsh-Me File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P2] Require stability across a rendered frame, not two immediate protocol reads
These two
page.evaluatesnapshots do not establish a settle boundary. On this exact head, a frame counter in the real Electron fixture showed that 91 of 100 snapshot pairs ran in the same animation frame, and a queuedrequestAnimationFramemutation could run only after both snapshots had returned the matchingturn-prompt-rail-120state. That is the same scheduling mechanism used by the production rail resolver inpackages/ui/src/prompt-anchor-rail.tsx:580-614.The practical failure remains reproducible:
--workers=4 --repeat-each=40failed this test 2/40 times at the subsequent last-tick assertion because the final tick no longer hadaria-current. The helper can therefore accept a mid-settle state, and this PR has not stabilized the target test. Please require agreement across an actual painted-frame/quiescence window, then rerun the concurrent stress case.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed on
add2b7c. The two reads are now separated bywaitForPaintedFrames(page, 6)— the same re-resolve window the production rail uses after a mutation (membershipFramesLeft = 6inpackages/ui/src/prompt-anchor-rail.tsx), so agreement now spans a real painted-frame boundary instead of two same-frame protocol reads. The poll timeout is raised to 15s to leave room for the six-frame windows across retries. The post-poll re-read stays deleted, so nothing is read after the poll that the poll did not see.One honest limitation: I could not run the
--workers=4 --repeat-eachstress case locally — the Desktop E2E suite needs Linux/Xvfb Electron and this dev machine is Windows. The concurrent stress run on this PR's CI job is the confirmation; if it still trips, the next suspect is the poll interval vs. frame cadence interaction.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed on
d4c6677, and the diagnosis was the key input: in every stress failure the helper had already returned, which means the state that flipped was stable — no fixed frame count between two reads can certify it. The mechanism behind the flip: the transcript keeps remeasuring turn content afterscrollTranscriptTo('bottom'),scrollHeightgrows whilescrollTopstays put, the snapshot'satEndbranch (scrollHeight - scrollTop - clientHeight <= 2) turns false,sourceTurnfalls back to the reading-band turn, and the rail moves current off the last prompt for good — exactly thearia-current-never-returns failure you saw at line 394.The helper is now a single in-page settle loop instead of protocol-side reads: every painted frame it re-reads the tick mapping together with
scrollTop/scrollHeight/clientHeight(the inputs whose drift drives the resolver), and it resolves only when that full state is byte-identical for six consecutive frames while one current tick maps from the Turn being read. That is the observable quiet state you asked for: every input the rail's resolver reacts to — scroll, mutation, geometry — is exactly what produced the asserted state, so reads after the helper see the same rail. The loop hands the verified state back and the helper asserts it; nothing is read after settle. In-page timeout is 10s, inside the test's 60s budget.Same limitation as before: no local Linux/Xvfb here, so please rerun the
--workers=4 --repeat-each=40case againstd4c6677— if the flip still happens, the next place to look would be a resolver input the state key does not cover.