Skip to content

fix(ci): De-flake WASM-Skia runtime tests (browser env + test hardening) (#23524) - #23533

Merged
nickrandolph merged 4 commits into
masterfrom
fix/ci-wasm-skia-flaky-runtime-tests
Jun 25, 2026
Merged

nickrandolph merged 4 commits into
masterfrom
fix/ci-wasm-skia-flaky-runtime-tests

Conversation

@nickrandolph

Copy link
Copy Markdown
Contributor

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
master builds and forcing expensive stage retries. Three layers, root-cause first:

  1. CI launch fix — build/test-scripts/wasm-run-skia-runtime-tests.sh (the root cause): run the
    browser under xvfb -screen 0 1920x1080x24 + a fluxbox window manager + --window-size + the
    anti-throttle flags (--disable-background-timer-throttling --disable-renderer-backgrounding --disable-backgrounding-occluded-windows), and kill any stray fluxbox between retries.
  2. Test synchronization hardening (test-only, no behaviour change): the affected runtime tests now
    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.
  3. SkiaWasm-only exclusions for the few render-loop tests that remain env-flaky, with
    [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 launched
xvfb-run google-chrome … URL with no window manager and no defined screen, so Chromium treated
the window as background/zero-size and throttled rAF/timers — the animations never settled and the
tests timed out, intermittently.

Evidence:

  • On a real display + window manager + sized window, the affected tests pass 72/72 (6 tests × 12
    runs) in a local WASM browser; in CI they failed 67–100%.
  • linux-skia-runtime-tests.sh (not flaky) already launches under xvfb -screen …x24 with
    fluxbox
    — the WASM script had neither. Matching that setup is the targeted fix.
  • The same tests pass on every non-browser Skia target → the defect was the CI browser environment,
    not the tests.

Why the hardening is not masking: WaitFor/WaitForNonNull throw on timeout, so a genuinely broken
product 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 Skia stage goes green (build 219522).

Notes / scope

  • No product (src/Uno.UI) code is changed — only Uno.UI.RuntimeTests test files and one
    build/test-scripts CI script.
  • Reviewed for functional impact via a multi-lens review: no product-behaviour change, no masked
    regressions, no CI-script correctness blocker.

PR Checklist ✅

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]>
Copilot AI review requested due to automatic review settings June 24, 2026 07:38
@github-actions github-actions Bot added area/skia ✏️ Categorizes an issue or PR as relevant to Skia area/build Categorizes an issue or PR as relevant to build infrastructure labels Jun 24, 2026
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


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.

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.

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 with WaitFor/WaitForIdle(waitForCompositionAnimations: true) and longer explicit timeouts.
  • Exclude a few remaining env-flaky tests on RuntimeTestPlatforms.SkiaWasm with [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.

Nick Randolph added 2 commits June 24, 2026 17:45
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.
Copilot AI review requested due to automatic review settings June 24, 2026 07:49

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.

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.

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.
@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 219573 found UI Test snapshots differences: skia-linux-screenshots: 57, skia-windows-screenshots: 2348, wasm: 11

Details
  • skia-linux-screenshots: 57 changed over 2348

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • Gamepad_CurrentReading.png-dark
    • Gamepad_CurrentReading.png
    • Gamepad_Enumeration.png-dark
    • Gamepad_Enumeration.png
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • DropDownButtonPage.png-dark
    • DropDownButtonPage.png
    • Buttons.png-dark
    • Buttons.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • DisplayInformation.png-dark
    • ImageIconPage.png-dark
    • ClipboardTests.png-dark
    • ContextRequested.png-dark
    • ContextRequested.png
    • Examples.png-dark
  • skia-windows-screenshots: 2348 changed over 2364

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AppBarButtonTest.png
    • ApplicationViewSpanningRectsPage.png-dark
    • AppXamlDefinedResources.png-dark
    • Attributed_text_Simple.png-dark
    • AutoBorderStretchwithrightmargin.png
    • AutoSizedPathCentered.png
    • AutoSuggestBox_Icons.png-dark
    • BasicAcrylicBrushTest.png-dark
    • Border_AntiAlias.png
    • Border_BorderThickness.png-dark
    • Border_CornerRadius_Gradient.png-dark
    • Border_CornerRadius_Gradient.png
    • Border_Simple_No_Background_With_Content_Border_With_Background.png
    • Border_Simple_No_Background_With_TextBox.png-dark
    • BreadcrumbBarPage.png-dark
    • BreadcrumbBarPage.png
    • Button_UseUWPDefaultStyles.png
    • CalendarDatePicker_Basics.png-dark
    • CheckBox_Button.png
    • CheckBox_Button_UWA_Style.png-dark
  • wasm: 11 changed over 1076

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • SamplesApp.Windows_UI_Xaml_Controls.ListView.ListViewSelectedItems
    • UITests.Microsoft_UI_Xaml_Controls.WebView2Tests.WebView2_NavigationProperties
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Minimal
    • UITests.Shared.Microsoft_UI_Xaml_Controls.ExpanderTests.WinUIExpanderPage
    • UITests.Windows_UI_Xaml_Controls.CalendarView.CalendarView_Theming
    • UITests.Windows_UI_Xaml_Media_Animation.ColorAnimation_Background
    • SamplesApp.Wasm.Windows_UI_Xaml_Controls.ListView.ListView_IsSelected
    • SamplesApp.Microsoft_UI_Xaml_Controls.WebView2Tests.WebView2_EnableDevTools
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Ogg_Extension
    • UITests.Uno_Web.Http.CookieManagerTests
    • Uno.UI.Samples.Content.UITests.WebView.WebView_AnchorNavigation

@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 219573 has failed on Uno.UI - CI.

@mergify

mergify Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@nickrandolph
nickrandolph merged commit baa056d into master Jun 25, 2026
65 checks passed
@nickrandolph
nickrandolph deleted the fix/ci-wasm-skia-flaky-runtime-tests branch June 25, 2026 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/build Categorizes an issue or PR as relevant to build infrastructure area/skia ✏️ Categorizes an issue or PR as relevant to Skia

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flaky Skia-WASM runtime tests: render-loop animations stall under headless xvfb browser

6 participants