Repository navigation
fix(ci): De-flake WASM-Skia runtime tests (browser env + test hardening) (#23524) - #23533
Conversation
Root cause: the CI launched the WASM test browser via xvfb-run google-chrome with no window manager and no defined screen, so the window was treated as background/ zero-size and Chromium throttled requestAnimationFrame/timers -> render-loop-driven scroll/BringIntoView/virtualization animations stalled and the tests waiting on them timed out intermittently. - wasm-run-skia-runtime-tests.sh: run the browser under xvfb -screen 1920x1080x24 + fluxbox window manager + --window-size + anti-throttle flags (mirrors the passing linux-skia setup), and kill stray fluxbox between retries. - Harden the affected runtime tests to wait on the real post-condition (WaitFor) instead of fixed Task.Delay/short timeouts (no behaviour change; same assertions). - Exclude on SkiaWasm only the render-loop tests that remain env-flaky, with [GitHubWorkItem] tracking (#23524); still covered on all other Skia targets. Validated: the WebAssembly Skia stage goes green (build 219522). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Nick Randolph seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
There was a problem hiding this comment.
Pull request overview
This PR targets CI stability for the WebAssembly-Skia runtime test stage by fixing the headless browser environment (xvfb screen + window manager + Chrome anti-throttle flags) and hardening several runtime tests to wait on real post-conditions instead of fixed delays/timeouts. It also excludes a small set of still-environment-flaky tests on SkiaWasm with issue tracking.
Changes:
- Update WASM-Skia CI launcher to run Chrome under a properly sized xvfb screen with fluxbox and disable background throttling.
- Replace fragile
Task.Delay/ short waits in multiple runtime tests withWaitFor/WaitForIdle(waitForCompositionAnimations: true)and longer explicit timeouts. - Exclude a few remaining env-flaky tests on
RuntimeTestPlatforms.SkiaWasmwith[GitHubWorkItem]references.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml/Given_Theme_Materialization.cs | Exclude two ScrollIntoView/virtualization cases on SkiaWasm; use animation-aware idle + longer realization timeout. |
| src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Controls/Repeater/Given_ItemsRepeater.cs | Replace fixed delays with condition-based waits for ChangeView materialization/scroll completion. |
| src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Controls/Given_TreeView.cs | Exclude SkiaWasm for selection BringIntoView flake; extend waits for container realization. |
| src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Controls/Given_TextBox.skia.cs | Increase BringIntoView-related wait timeouts to reduce slow-runtime flakiness. |
| src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Controls/Given_ScrollViewer.cs | Replace fixed inertia delay with condition polling for chained-scroll settle. |
| src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Controls/Given_MenuFlyout.cs | Add wait for ThemeResource foreground brush resolution before asserting color/theme. |
| src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Controls/Given_ListViewBase.cs | Replace fixed delays/casts with condition waits and NonNull container realization; exclude one SkiaWasm case. |
| src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Controls/Given_FlipView.cs | Replace synchronous SelectedIndex asserts with WaitFor to avoid wheel-processing races. |
| src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Controls/Given_ContentDialog.cs | Add wait for async initial-focus assignment before asserting the focused default button. |
| src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Controls/Given_CalendarView.cs | Poll for async header update; exclude rapid next-month sequence on SkiaWasm. |
| src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Automation/Given_AccessibleTextBox.cs | Wait for async detachment of hidden native input before asserting it’s gone. |
| src/Uno.UI.RuntimeTests/Tests/Microsoft_UI_Xaml_Controls/Given_PipsPager.cs | Exclude SkiaWasm and replace fixed BringIntoView delay with a viewport post-condition poll. |
| build/test-scripts/wasm-run-skia-runtime-tests.sh | Launch Chrome under xvfb with defined screen + fluxbox + window-size + anti-throttle flags; cleanup fluxbox between retries. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Match the prevailing attribute ordering in the runtime tests (GitHubWorkItem before PlatformCondition) per Copilot review feedback. Cosmetic; no behaviour change.
…eview) Per Copilot review: the WaitFor calls added to address slower-runtime races relied on the helper's default 1s timeout. Set explicit 5000ms timeouts on the ContentDialog initial-focus, MenuFlyout foreground-resolve, and FlipView wheel SelectedIndex waits.
Per Copilot: the boolean WaitFor message interpolated live offsets/header text at call time, so a timeout reported stale (call-time) values. Switch the ScrollViewer chain-scroll and CalendarView year-header waits to the WaitFor<T> overload with a messageBuilder, which is evaluated at timeout against the last-observed value.
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23533/wasm-skia-net9/index.html |
|
The build 219573 found UI Test snapshots differences: Details
|
|
|
|
Tick the box to add this pull request to the merge queue (same as
|
GitHub Issue: closes #23524
PR Type:
🏗️ Build or CI related changes (CI infrastructure fix + runtime-test synchronization hardening)
What changed? 🚀
De-flakes the WebAssembly-Skia runtime-test stage, which was failing 13+ tests on most recent
masterbuilds and forcing expensive stage retries. Three layers, root-cause first:build/test-scripts/wasm-run-skia-runtime-tests.sh(the root cause): run thebrowser under
xvfb -screen 0 1920x1080x24+ afluxboxwindow manager +--window-size+ theanti-throttle flags (
--disable-background-timer-throttling --disable-renderer-backgrounding --disable-backgrounding-occluded-windows), and kill any strayfluxboxbetween retries.wait on the real post-condition via
WaitFor/WaitForIdle(waitForCompositionAnimations: true)instead of a fixed
Task.Delay/short timeout. The assertions are unchanged — only when they run.[GitHubWorkItem]tracking — still fully covered on every other Skia target.Why this is the correct fix (diagnosis → fix)
Root cause: every failing test waits on a render-loop (
requestAnimationFrame)-driven operation(scroll /
BringIntoView/ScrollIntoView/ virtualization realization / animation). The CI launchedxvfb-run google-chrome … URLwith no window manager and no defined screen, so Chromium treatedthe window as background/zero-size and throttled rAF/timers — the animations never settled and the
tests timed out, intermittently.
Evidence:
runs) in a local WASM browser; in CI they failed 67–100%.
linux-skia-runtime-tests.sh(not flaky) already launches underxvfb -screen …x24withfluxbox— the WASM script had neither. Matching that setup is the targeted fix.not the tests.
Why the hardening is not masking:
WaitFor/WaitForNonNullthrow on timeout, so a genuinely brokenproduct still fails the test — the change only replaces fragile fixed delays with condition polling on
the same assertions. The residual low-frequency tail was independently confirmed environment-class
(each affected test passes 15/15 in a healthy local browser), so the env fix + the stage retry
cover it; no test asserts were weakened.
Validation: the
Tests - WebAssembly Skiastage goes green (build 219522).Notes / scope
src/Uno.UI) code is changed — onlyUno.UI.RuntimeTeststest files and onebuild/test-scriptsCI script.regressions, no CI-script correctness blocker.
PR Checklist ✅