Wait for the posted comment's mark before aiming the next diagram box - #196
Merged
Conversation
round_trip returns when the page has heard back what it sent, which is before it has drawn it. Applying the comment repaints the diagram's marks and hangs its note on the element, and that repaint takes an open response surface down: the aim that follows opens a composer the arriving comment then closes, so the field is hidden or unfocused when the test reads it. Wait for the note the comment hangs on the diagram — the projection landing — so every later aim is on a settled page.
This was referenced Sep 2, 2026
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.
Problem
cirun 33537688138 on2326a8dcame back 11 failed, 1618 passed, 6 skipped. Ten of those eleven are already fixed by #192. The eleventh is not, and is nobody else's:test_render_aim.py::test_a_declared_box_takes_its_comment_on_every_type_that_carries_an_idaims at the next diagram box while the comment it just posted is still arriving, and the arrival takes the response surface down under the gesture.Solution
round_tripends when the page has heard back what it sent, which is before it has drawn what came back. Applying the comment repaints the diagram's marks and hangs itslf-mark-noteon the element, and that repaint takes an open response surface down with it — so an aim placed in the gap opens a composer the arriving comment then closes. The test now waits for that note before the next aim, which is the same orderingtest_a_declared_flowchart_node_keeps_its_comment_across_renderingsalready states for the same widget.Instrumented on
main, the failing run reads (performance.now()ms, from a probe on the fab bar and on#life):The aim at 2744 was correct — the bar's
aria-labelreadRespond to diagram · Build— and the projection landing at 2803 closed it. That is why the same test failed asLocator expected to be focusedin CI and asLocator expected to be visiblelocally:showFab(null)hides the composer, then the bar, so which assertion inopen_compact_commentcatches it depends on where the 5s budget lands.This is the gesture-ahead-of-the-page class
running-tendnames, so the fix is the ordering statement rather than a retry.Testing
Reproduced on
mainat roughly 1 in 25–40 runs under four-worker contention (failures at iterations 4, 38, 7, and 65 of separate loops);#life > .lf-mark-notewas absent at the aim in every captured failure. With the wait, 180 consecutive runs of the test under the same contention passed, plusuv run pytest tests/test_render_aim.py --run-nightly(34 passed), the everydayuv run pytest tests(764 passed, 6 skipped), andpre-commit run --files tests/test_render_aim.py.Why this is a separate PR from #192
#192 fixes the other ten failures in the same run and does not touch
tests/test_render_aim.py; the two changes share no file and either could be reverted without the other. #192's owntests/interact_support.pyhelper already coverstest_mcp_app.py::test_registered_server_prefers_full_page_and_keeps_snapshot_as_fallback, which is new in this run because #188'sciwas cancelled by #191's push before its nightly leg ran, sod55e574never had a nightly result.One thing this leaves
A reader can do what the test did: Alt-click a box in the window between sending a comment and its projection landing, and have the composer they just opened close under them.
refreshFabtears the surface down whenplaceFabcannot resolve the anchor's box during that repaint, which is a product question about whether an arriving projection may dismiss a response surface opened on a different anchor — not something to settle inside a test fix.Automated fix for failed run