Skip to content

test: wait for the margin marker to be visible before focusing it in the seated-thread test - #6667

Merged
leaf-agent merged 1 commit into
mainfrom
fix/issue-6664
Nov 21, 2026
Merged

leaf-agent merged 1 commit into
mainfrom
fix/issue-6664

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

test_a_user_on_a_thread_returning_to_the_diff_goes_with_it[marker] focused the margin marker straight after told(page), which waits only through the page's state stage. The margin row that the patch change brings in stays visibility: hidden until layout gives it a place (.lf-margin-cluster:not([data-lf-place]), browser/runtime/annotation-overlay/annotation-theme.css). Under load, focus() reached the marker while it was still hidden. That call did nothing, and Playwright doesn't retry it, so the focus assertion waited out its 120 s timeout. The test now waits for the marker to be visible before focusing it. The product doesn't change: a user can't Tab onto a row that hasn't been placed either. The test's close route already waited, because click() checks visibility first.

Evidence on CI's Mac (--workers 3 --load 2):

  • Before: 2 of 18 copies failed at f1d623be2 (44922543784). In an instrumented copy of the base test, 6 of 36 failed (44925329166). In those copies document.hasFocus() was true and activeElement was <body>, and no focusin ever reached a margin marker. So the page didn't lose focus as a whole; focus() simply never took.
  • After: 54 of 54 copies passed on this branch (44926183383).

Cause of a failure tracked in #6659.

Closes #6664 — automated triage

test_a_user_on_a_thread_returning_to_the_diff_goes_with_it[marker] focused the
marker right after told(page), which waits only through the state stage. The
margin row the patch change brings stays visibility: hidden until layout gives it
a place (annotation-theme.css), so under load focus() landed on a hidden marker,
did nothing, and the focus assertion waited out its timeout. The test now waits
for the marker to be visible first. No product behavior changes.

Closes #6664
@leaf-agent
leaf-agent merged commit b305ea0 into main Nov 21, 2026
11 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-6664 branch November 21, 2026 17:11
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.

test_a_user_on_a_thread_returning_to_the_diff_goes_with_it[marker]: the page reports inactive focus after marker.focus(), intermittently on macOS

1 participant