You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
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 #6664
tests/browser/threads/test_seated_threads.py::test_a_user_on_a_thread_returning_to_the_diff_goes_with_it[marker] fails intermittently on the macOS runner at test_seated_threads.py:929. This is the step right after marker.focus(), before the diff changes back:
AssertionError: Locator expected to be focused
Actual value: inactive
236 × locator resolved to <span tabindex="0" role="button" … class="lf-margin-marker" data-lf-kinds="comment" …>
The locator resolved to the same marker on every poll for the whole 120 s timeout. Playwright reported inactive, not "not focused", so the page apparently lost focus as a whole rather than the marker losing it to another element or being replaced. That needs confirming: compare document.activeElement and document.hasFocus() in a failing copy.
Evidence (ci dispatches on the macOS runner):
Scheduled run 44896279165 on c72a8ad03: failed. The test hadn't failed in the eleven scheduled macOS runs before it.
44920350281, --workers 1 --load 4 --copies 6 at c72a8ad03: 6 of 6 passed.
44922543784, --workers 3 --load 2 --copies 18 at f1d623be2: 2 of 18 failed with the same inactive reading.
It reproduces with three copies running in parallel and not with one, so the next step is to check what in the browser fixture can take focus away from a page while another copy runs. Dispatch command:
gh workflow run ci --ref BRANCH -f flake="--workers 3 --load 2 --copies 18 'tests/browser/threads/test_seated_threads.py::test_a_user_on_a_thread_returning_to_the_diff_goes_with_it[marker]'"
This is a test race, and #6667 fixes it. The page never lost focus: instrumented copies on CI's Mac failed with document.hasFocus() true and activeElement on <body>, and no focusin ever reached a margin marker. told(page) waits only through the state stage. The margin row the patch change brings stays visibility: hidden until layout places it (annotation-theme.css), so under load marker.focus() hit a hidden marker and did nothing. Playwright reads not-focused as inactive; that word doesn't mean the page lost focus.
#6667 waits for the marker to be visible before focusing it. The original dispatch passes 54 of 54 copies on the branch (44926183383), against 2 of 18 failing on f1d623be2. The PR's own CI and landing are still pending.
Activity
test: keep the honest-table fixture's code cell on white-space: pre (#…
test: diagnostics for #6664 via init script (not for merge)
leaf-agent commentedon Nov 21, 2026
This is a test race, and #6667 fixes it. The page never lost focus: instrumented copies on CI's Mac failed with
document.hasFocus()true andactiveElementon<body>, and nofocusinever reached a margin marker.told(page)waits only through thestatestage. The margin row the patch change brings staysvisibility: hiddenuntil layout places it (annotation-theme.css), so under loadmarker.focus()hit a hidden marker and did nothing. Playwright reads not-focused asinactive; that word doesn't mean the page lost focus.#6667 waits for the marker to be visible before focusing it. The original dispatch passes 54 of 54 copies on the branch (44926183383), against 2 of 18 failing on
f1d623be2. The PR's own CI and landing are still pending.