[Components][E2E] Stabilize NonZeroStartIndex_ScrollToMiddleThenMeasure test setup#66290
Merged
ilonatommy merged 6 commits intodotnet:mainfrom Apr 17, 2026
Conversation
Apply the same retry-based scroll stabilization pattern from PR dotnet#66194 to NonZeroStartIndex_ScrollToMiddleThenMeasure. The test was racing in server mode because it set scrollTop and then immediately checked the rendered items, but the async virtualization update had not finished yet. The fix computes the target offset up front, then retries both the scroll assignment and the rendered-index check inside a single Browser.True() loop before calling WaitForScrollStabilization. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
04ec60f to
67ea598
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Stabilizes the setup phase of the ServerVirtualizationTest.NonZeroStartIndex_ScrollToMiddleThenMeasure E2E test by switching to a retry-based scroll-and-verify pattern, reducing flakiness from async virtualization updates in server mode.
Changes:
- Computes the target mid-scroll offset up front (
scrollHeight / 2). - Retries both applying
scrollTopand confirming the rendered range advanced (idx > 50) inside a singleBrowser.True()polling loop. - Defers
WaitForScrollStabilization()until after the rendered range has reliably advanced.
This was referenced Apr 13, 2026
Open
…ization helper - Fix missing space around = in targetScrollTop assignment - Extract scroll+retry logic into generalized ScrollToOffsetWithStabilization overload - Reuse the helper in NonZeroStartIndex_ScrollToMiddleThenMeasure instead of duplicating Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ntined Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…e, restore missing PrependItems quarantine The merge from main incorrectly re-introduced a quarantine for CanElevateEffectiveMaxItemCount_WhenOverscanExceedsMax (dotnet#65962) which was already fixed and unquarantined by dotnet#66291 on main. It also dropped the DynamicContent_PrependItemsWhileScrolledToMiddle quarantine (dotnet#66308) that was added by dotnet#66312 on main. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…x test Replace the retry-based ScrollToOffsetWithStabilization call with a single scrollTop assignment followed by a MutationObserver that waits for Blazor's DOM update to settle. This makes the test more deterministic: it scrolls once and waits for the effect, rather than retrying the scroll which could mask real bugs where the component fails to handle the initial scroll correctly. The MutationObserver waits for a 200ms quiet period after the last DOM mutation, with a 2s fallback timeout. After that, scroll position stabilization is verified, and the item index assertion is a hard assert (not a retry loop). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
javiercn
approved these changes
Apr 17, 2026
wtgodbe
added a commit
that referenced
this pull request
Apr 20, 2026
…Index_ScrollToMiddleThenMeasure (#66359) * Re-quarantine ServerVirtualizationTest.NonZeroStartIndex_ScrollToMiddleThenMeasure Test started failing again after being unquarantined in PR #66290. Re-quarantining using the original issue #66119. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix ServerVirtualizationTest quarantine method declaration Agent-Logs-Url: https://github.com/dotnet/aspnetcore/sessions/0d16c75a-b957-40e6-8d3e-f7af5396923d Co-authored-by: wtgodbe <14283640+wtgodbe@users.noreply.github.com> * Make virtualization test overridable for server quarantine Agent-Logs-Url: https://github.com/dotnet/aspnetcore/sessions/0d16c75a-b957-40e6-8d3e-f7af5396923d Co-authored-by: wtgodbe <14283640+wtgodbe@users.noreply.github.com> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: wtgodbe <14283640+wtgodbe@users.noreply.github.com>
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.
Summary
Fix the flaky
ServerVirtualizationTest.NonZeroStartIndex_ScrollToMiddleThenMeasureE2E test by replacing the retry-based scroll pattern with a deterministic MutationObserver approach.Why
he test was flaky in server mode because it set
scrollTopand immediately checked rendered items, but the async virtualization update (which round-trips through SignalR) hadn't finished yet.Recent failure: build 1375485 (April 12, 2026)
NonZeroStartIndex_ScrollToMiddleThenMeasure— MutationObserver instead of scroll retryscrollToptoscrollHeight / 2once viaExecuteAsyncScriptMutationObserverto wait for Blazor's DOM update to settle (200ms quiet period after last mutation, 2s fallback)WaitForScrollStabilization()to confirm the scroll position stopped bouncingAssert.True(not a retry loop) to verify items withindex > 50are visiblevirtualto non-virtual— the fix is in the base class, no server-specific override neededScrollToOffsetWithStabilization— generalized into two overloadsFunc<bool> itemCheckPredicatefor custom scroll-success criteriaFixes #66119.