Skip to content

Wait for the posted comment's mark before aiming the next diagram box - #196

Merged
max-sixty merged 1 commit into
mainfrom
fix/ci-33537688138
Sep 1, 2026
Merged

Wait for the posted comment's mark before aiming the next diagram box#196
max-sixty merged 1 commit into
mainfrom
fix/ci-33537688138

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

Problem

ci run 33537688138 on 2326a8d came 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_id aims 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_trip ends 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 its lf-mark-note on 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 ordering test_a_declared_flowchart_node_keeps_its_comment_across_renderings already 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):

2723  second Alt-click — the Queued composer closes
2744  composer reopens on Build, focused; bar placed at (634, 472)
2803  ['life', childList, LF-DIAGRAM]  + ['life', childList, BUTTON lf-mark-note]
2803  .lf-composer display:none, .lf-fab-bar display:none, .lf-fab-input display:none

The aim at 2744 was correct — the bar's aria-label read Respond to diagram · Build — and the projection landing at 2803 closed it. That is why the same test failed as Locator expected to be focused in CI and as Locator expected to be visible locally: showFab(null) hides the composer, then the bar, so which assertion in open_compact_comment catches it depends on where the 5s budget lands.

This is the gesture-ahead-of-the-page class running-tend names, so the fix is the ordering statement rather than a retry.

Testing

Reproduced on main at roughly 1 in 25–40 runs under four-worker contention (failures at iterations 4, 38, 7, and 65 of separate loops); #life > .lf-mark-note was absent at the aim in every captured failure. With the wait, 180 consecutive runs of the test under the same contention passed, plus uv run pytest tests/test_render_aim.py --run-nightly (34 passed), the everyday uv run pytest tests (764 passed, 6 skipped), and pre-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 own tests/interact_support.py helper already covers test_mcp_app.py::test_registered_server_prefers_full_page_and_keeps_snapshot_as_fallback, which is new in this run because #188's ci was cancelled by #191's push before its nightly leg ran, so d55e574 never 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. refreshFab tears the surface down when placeFab cannot 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

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.
@max-sixty
max-sixty merged commit 8aa71b7 into main Sep 1, 2026
3 checks passed
@max-sixty
max-sixty deleted the fix/ci-33537688138 branch September 1, 2026 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants