Repository navigation
Fix flaky QuickGrid paginator E2E test by waiting for rerender completion - #67978
Conversation
ilonatommy
left a comment
There was a problem hiding this comment.
@irfanajaffer, thank you for the contribution. It would be good to add an information about the stats in the PR description, how many times did you have to run to reproduce the failure locally and how many times you run with the fix - to prove to the reviewers that the change is tested and justified.
|
@irfanajaffer why did you merge with main? |
|
Sorry, that was unintended. I saw a remaining check and tried to retrigger it by updating/rebasing my branch. It ended up bringing in main and creating the merge commit. Apologies for the confusion and inconvenience. |
That one can be triggered only by us, no worries. Did you already manage to gather the stats from local runs for this PR? It will be helpful even in the future, if the bot will catch new failures on this test, to analyze the history of fixes. |
|
Thanks for following up. We were not able to reproduce the failure locally, so we could not gather before/after reproduction statistics for the specific flaky behavior. As part of the validation, we ran the test both individually and in 100 repeated iterations, and all executions passed successfully without reproducing the failure. We've added these validation details to the PR description so there is historical context available for future investigations, especially if the bot reports new failures on this test. While we do not have reproduction metrics for the original failure, the recorded local validation results and investigation notes should help with future analysis. |
Stabilize and Unquarantine QuickGridInteractiveTest.PaginatorCorrectItemsPerPage
Description
This PR addresses flakiness in
QuickGridInteractiveTest.PaginatorCorrectItemsPerPage.The test was previously quarantined due to intermittent
StaleElementReferenceExceptionfailures. When the paginator advances to thenext page, QuickGrid triggers a Blazor rerender that recreates both the
paginator elements and the grid rows. As a result, Selenium can occasionally
attempt to interact with DOM elements that have been replaced, causing stale
element failures.
To make the test more resilient, the assertions have been updated to use
Browser.Equal(...)with DOM queries performed inside the assertion delegate.This allows the test framework to retry until the expected UI state is reached
while resolving fresh DOM elements on each poll.
The updated assertions explicitly wait for:
This follows the same stabilization pattern used in PR #67677 by avoiding
interactions with potentially stale element references and validating the UI
only after rendering has completed.
With these changes in place, the test no longer reproduces the flaky behavior
that originally led to quarantine.
Validation / Investigation
As part of the investigation:
While we were unable to gather before/after reproduction statistics due to the inability to reproduce the issue locally, the change aligns the test with an existing stabilization pattern and improves resiliency against rerender-related stale element interactions.
Changes
Browser.Equal(...)assertions.references are used on every retry.
stabilization approach.
[QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/67350")]from
PaginatorCorrectItemsPerPage.Fixes #67350