Repository navigation
Wait for real provider progress in the virtualization cancellation test - #70804
Conversation
Wait for initial loading and loaded items before scrolling, and observe a new pending placeholder window between native scrolls. Preserve every existing scroll and cancellation assertion without changing the test asset or shipping code. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block the test-only synchronization change intended to reduce timing-related virtualization cancellation failures.
No open issues 🎉
What changed in this PR
This PR addresses #70803 by synchronizing the existing virtualization cancellation test with observable provider progress, reducing timing-related failures without changing shipping code.
Changes:
- Wait for initial loading and loaded items before scrolling.
- Wait for a distinct pending-placeholder window after each native scroll.
- Preserve exact scroll-position checks and the final cancellation-count assertion.
| File | Description |
|---|---|
src/Components/test/E2ETest/Tests/VirtualizationTest.cs |
Adds observable DOM waits to CancelsOutdatedRefreshes_Async for the existing Server/WASM Selenium cases. |
Review effort: Balanced
|
/review |
There was a problem hiding this comment.
Source-only review of dotnet/aspnetcore#70804 at d81702d4f0949b99ac50cd1feab4e9e5708f9f2d: one unresolved P3 test-reliability concern, no verified defect. The new pre-scroll placeholder snapshot is outside a retry. The exact DOM replacement and stale-element response needed to abort this test were not established; a pending observer callback can leave the distribution unchanged, and a render can retain the selected node.
Guide completion: Cross-cutting and Blazor Components both completed their in-scope source review. The only changed area is one existing Server/WASM Selenium test. The guides traced the native scroll–observer–provider path and checked the test boundary and false-pass risk: the unchanged final assertion proves at least one cancellation, not one per scroll, and the previous version could already pass with favorable timing. No materially changed area lacked a routed guide.
Existing feedback: No equivalent finding in the frozen snapshot. Review 6049440029 describes the synchronization changes but does not raise the snapshot issue. Feedback after preparation was not observable.
DISCARDED
- Loading-marker concerns:
Virtualize.cs:566–571passes_loadingto the elementAddAttribute(int, string, bool)overload.RenderTreeBuilder.cs:192–209emits the attribute when true and omits it when false;WaitAssert.cs:63–83polls for a match. The selector can observe pending state before items load. - Synthetic scroll concern:
VirtualizationTest.cs:421calls nativescrollTo;Virtualize.ts:889–907,996–1084still owns browser-observer delivery. The test does not inject an observer callback.
Provenance and limits: Frozen merge base a6110c23cfa4805ee95a6a00ee3812a1e9f1857f; base tip and immutable workflow guidance d848fbf2e3ead0c4f7aa53df35e9b808960a5dea. Source only: no build, tests, CI, browser workflow, or samples were run; reported PR runs are not independent evidence. Security assessment was excluded.
Generated by ASP.NET Core Pull Request Review for #70804 · copilot · gpt62 · 133.2 AIC · ⌖ 7.27 AIC · ⊞ 19K
Comment /review to run again
|
|
||
| for (var y = 1000; y <= 5000; y += 1000) | ||
| { | ||
| var previousPlaceholder = Browser.FindElements(By.Id("async-placeholder")).FirstOrDefault()?.Text; |
There was a problem hiding this comment.
P3 · unresolved — [UNRESOLVED] A stale placeholder reference could abort the test before the next scroll.
Why unresolved: No real-browser trace or faithful reproduction of the existing Server or WASM five-scroll case shows a pending callback detaching the exact node returned by FindElements before .Text and the stale-element response aborting the test. A callback can leave the distribution unchanged, and a render can retain the selected node.
Repro scenario (not confirmed): Run CancelsOutdatedRefreshes_Async in the Server or WASM Selenium suite. After a changed-placeholder wait succeeds, a delayed render would need to detach the next iteration’s selected placeholder between lookup and text retrieval.
What goes wrong: The old loop did not make this read. Unlike the later Browser.True predicate, this snapshot does not retry a stale element, so the run could stop before the cancellation assertion.
If confirmed, retry the lookup and text read together, keeping a missing placeholder a valid baseline:
var previousPlaceholder = Browser.Exists(
() => Browser.FindElements(By.Id("async-placeholder")).FirstOrDefault()?.Text,
timeout: default);|
✅ No documentation PR was created. Confidence that documentation is needed: 2% No docs needed: the PR only synchronizes an existing E2E test with real virtualization requests. No shipping code changed. Documentation surfaces considered
|
Wait for real provider progress in the virtualization cancellation test
Synchronize the existing cancellation test with real virtualized data requests.
Description
Only eight lines are added to
CancelsOutdatedRefreshes_Async; no shipping code, test asset, assertions, browser defaults or package versions change.Wait for the existing loading attribute before releasing the initial provider, then wait for actual loaded items before scrolling. After each native
scrollTo, wait for a new non-null pending-placeholder window before issuing another scroll. Preserve every exact scroll-position wait and the final cancellation-count assertion.This prevents the initial scroll from being clamped before data establishes the scroll extent, and prevents all five scrolls from coalescing into one provider request. There are no sleeps or injected observer/provider callbacks.
Boundary: Virtualize and its native browser observers own request production. Existing loading/placeholder DOM observes that real path; the existing cancellation count observes the material result. Permanent coverage remains the existing Server/WASM Selenium cases. A synthetic callback test would bypass the lost-scroll/coalescing preconditions.
Red/green evidence
Against current main
a6110c23cf, the unchanged two-case run initially passed, then a fresh repeat failedServerVirtualizationTest.CancelsOutdatedRefreshes_Asyncat the exact scroll-position wait, line 420. The WASM case passed both baseline runs; no WASM baseline failure is claimed.An intermediate counter-instrumented test-asset variant passed the cancellation cases but failed the server sizing control (7/8 passed). That approach was discarded entirely. The final change observes existing DOM and has no test-asset diff.
All commands ran after
source activate.shin the same immutable AL4 Chrome image used by #70689 (sha256:42d8a12504aa39a3c6e336a43937320a7086ad87701dd7b5d1e1c7cc6a8ddd30), SDK12.0.100-alpha.1.26557.102, Chrome 158, default viewport and untrimmed Release applications.Build: passed, zero warnings/errors.
Final targeted run: Passed: 8, Failed: 0, Skipped: 0, exit 0. Both Server/WASM cancellation cases plus
RerendersWhenItemSizeShrinks_Async,RerendersWhenItemSizeShrinks_SyncandEmptyContentRendered_Asynccontrols passed.Five additional fresh runs: Passed: 2, Failed: 0, Skipped: 0 each, all exit 0. This is a bounded stability sample, not proof across hosts/load.
Every exported final TRX was parsed: exact expected names/counts, unique execution/test identities, matching definitions, all executed/passed and zero skipped/failed/aborted/pending. The expected failing baseline was separately parsed.
Formatting and diff checks: passed, exit 0.
Draft pending complete hosted/trimmed Components E2E qualification.
Fixes #70803.