Repository navigation
test: focus the diff header directly in the sideways-reader test, without the animated close - #6500
Merged
Merged
Conversation
…hout the animated close `test_a_changed_diff_file_keeps_its_sideways_reader` put focus on the first file's header by clicking it (closing the file), pressing Tab, refocusing the header and pressing ArrowRight to reopen it. A pointer close runs the fold's collapse animation (`--lf-motion-fold`, packages/diff/styles/disclosure.css). While it runs, the closing file still has height, so its sticky header stays pinned at the window's top. Tab had scrolled the second file's comment button into view, and `scroll_settled` returns at once because the fold moves no scroll. So `focus()` found the header on screen and didn't scroll. Once the fold finished, the header sat above the window (top -36 at scrollY 1433 in a captured failure). ArrowRight then let go of focus the user can't see instead of opening the file, and `]` walked into app/routes.py, which is the end state every CI failure showed. Both files start open, so the test now focuses the first header directly and walks its hunks from there. What it protects is unchanged: a refreshed file keeps its sideways scroll and its focused row. The click, Tab and ArrowRight were setup from the test's first version (#1624), not behavior under test. Before: 8 of 12 local runs failed at the first `]`. After: 10 of 10 local runs and 18 of 18 copies under `leaf-dev suite flake --cpu-throttle 8` passed. Refs #5883
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.
test_a_changed_diff_file_keeps_its_sideways_readerfailed intermittently at its first]because its setup acted during an animated close. The test now focuses the first file's header directly instead. That removes the race: 10 of 10 local runs and 18 of 18 copies at--cpu-throttle 8pass, against 8 failures in 12 local runs before.Cause. To reach the header, the test clicked it (closing the file), pressed Tab, refocused the header and pressed
ArrowRightto reopen it. A pointer close runs the fold's collapse animation (--lf-motion-fold,disclosure.css). While the collapse runs, the closing file still has height, so its sticky header stays pinned at the window's top. Tab scrolls the next file's comment button into view, andscroll_settledreturns at once because the fold doesn't move the scroll. Sofocus()finds the header on screen and doesn't scroll. When the fold ends, the header sits above the window: in a captured failure it was at top −36 withscrollYstill 1433.ArrowRightthen lets go of focus the user can't see (letsGoinkeyboard/controller.js) instead of opening the file, and]walks intoapp/routes.py. That is the end state in every CI failure listed on #5883, including the two after #6279.Change. Both files start open, so focusing the first header and walking its hunks gives the same starting point. The click, Tab and
ArrowRightcame with the test's first version (#1624) as setup, not as the behavior under test. What the test protects is unchanged: a refreshed file keeps its sideways scroll and its focused row. The product behaves as designed throughout: a key pressed on a header that has left the screen lets go of it.Captured failing sequence (event log in the page)
A passing run with the same log shows
document.scrollHeightshrinking over several frames after Tab (3362 → 3017) withscrollYfixed, which is the fold collapsing.Refs #5883 — automated triage. The issue's other undiagnosed failures, such as the visual action's
Locator.focustimeout, are untouched.