Skip to content

[test-quarantine] Stabilize Virtualization Home/End test assertions - #69172

Merged
ilonatommy merged 4 commits into
dotnet:mainfrom
vendasankarsf3945:fix/68772-home-end-flake
Sep 10, 2026
Merged

ilonatommy merged 4 commits into
dotnet:mainfrom
vendasankarsf3945:fix/68772-home-end-flake

Conversation

@vendasankarsf3945

Copy link
Copy Markdown
Contributor

Stabilize Virtualization Home/End test assertions

Description

This change addresses the intermittent failure in:

Microsoft.AspNetCore.Components.E2ETest.ServerExecutionTests.ServerVirtualizationTest.InitialIndex_RetainsTargetWhenPreviousItemExpandsThenHomeEndTakeOver

The failure was caused by timing-sensitive virtualization behavior after expanding an item and subsequently using the Home/End keys. In rare cases, the test asserted the expected item before the virtualization system had fully updated the rendered content, resulting in a flaky failure.

Changes made

  • Improved the test validation logic for virtualization Home/End keyboard navigation.
  • Added retryable assertions instead of relying on timing-sensitive validation.
  • Ensured the expected target item is rendered before completing the assertion.
  • Reduced intermittent failures caused by asynchronous rendering and scrolling updates in the virtualization component.

Validation

  • Reproduced and analyzed the reported failure scenario.
  • Executed the affected test repeatedly to verify stability.
  • Ran the test more than 200 times without observing any failures.
  • Confirmed that the change improves reliability without altering product behavior.

Fixes #68772

@github-actions github-actions Bot added the area-blazor Includes: Blazor, Razor Components label Sep 9, 2026
@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Sep 9, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Thanks for your PR, @vendasankarsf3945. Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@vendasankarsf3945 vendasankarsf3945 changed the title Stabilize Virtualization Home/End test assertions [test-quarantine] Stabilize Virtualization Home/End test assertions Sep 9, 2026
@vendasankarsf3945
vendasankarsf3945 marked this pull request as ready for review September 9, 2026 12:09
Copilot AI lite review requested due to automatic review settings September 9, 2026 12:09
@vendasankarsf3945
vendasankarsf3945 requested a review from a team as a code owner September 9, 2026 12:09

@ilonatommy ilonatommy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks correct.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The change is isolated to E2E test logic and uses existing stabilization helpers; only a minor assertion-message clarity nit was identified.

Pull request overview

This PR stabilizes a previously quarantined Blazor Virtualize E2E test by reducing timing sensitivity around Home/End keyboard navigation after a variable-height expansion, then removes the quarantine marker once the assertions are made more robust.

Changes:

  • Removed the [QuarantinedTest] attribute from the affected theory.
  • Added WaitForRenderToSettle(...) calls around Home/End navigation to allow async rendering/scrolling to stabilize.
  • Updated the post-Home assertion to validate via GetTopRenderedIndex(js) == 0 rather than DOM presence of a specific item element.
File summaries
File Description
src/Components/test/E2ETest/Tests/VirtualizationTest.cs Stabilizes the flaky virtualization Home/End test by waiting for render cycles to settle and using a less timing-sensitive assertion, then un-quarantines the test.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-blazor Includes: Blazor, Razor Components community-contribution Indicates that the PR has been added by a community member

Projects

None yet

3 participants