Repository navigation
Description
Summary
A cluster of Skia-on-WebAssembly runtime tests is flaky in CI (fails 4–6 of every 6 master
builds), forcing expensive stage retries and keeping master red. The same tests pass reliably on
Linux/Windows/macOS/Android Skia (identical managed Skia code) — only the browser host flakes.
Root cause (investigated)
The failing tests all wait on a render-loop (requestAnimationFrame)-driven operation —
scroll / BringIntoView / ScrollIntoView / virtualization realization / animation. In CI,
build/test-scripts/wasm-run-skia-runtime-tests.sh launched xvfb-run google-chrome … URL with
no window manager and an unspecified screen, so the browser window is effectively
background/zero-size and Chromium throttles rAF/timers (~1 Hz) and/or starves rendering. The
animations then never settle and the tests time out.
Evidence:
- Locally (headful Edge, real display + WM + sized window) the 6 representative tests pass 72/72
(6 tests × 12 runs); in CI they fail 67–100%. linux-skia-runtime-tests.sh(which is not flaky) launches its app under
xvfb -screen 0 1280x1024x24withfluxbox— the WASM script had neither.- A normally ~1 s scroll animation timing out at >5 s matches rAF throttled to ~1 Hz.
Partial fix applied (PR #23521)
wasm-run-skia-runtime-tests.sh now mirrors the passing linux-skia setup
(-screen 0 1920x1080x24 + fluxbox + --window-size + --disable-background-timer-throttling --disable-renderer-backgrounding --disable-backgrounding-occluded-windows). This reduced the
WASM-Skia runtime failures (≈13 → ≈10 distinct) but did not eliminate them — the headless
browser still does not reliably drive these animations. Deeper work is needed (e.g. a test-harness
render-loop pump on WASM, or making these scrolls non-animated under test).
Affected tests
Environment-rooted scroll/virtualization/animation (excluded on SkiaWasm via [GitHubWorkItem]
pending the deeper fix; still covered on all other Skia targets):
Given_PipsPager.When_SelectedIndex_Beyond_MaxVisiblePips_All_Visible_Pips_Are_RealizedGiven_Theme_Materialization.When_Virtualized_Item_In_Light_Island_Under_Dark_Ambient_Resolves_LightGiven_Theme_Materialization.When_Nested_Template_Cell_Scrolled_Into_View_Resolves_LightGiven_TreeView.When_SelectNode_DoesNotToggle_OtherNodesExpansionGiven_ListViewBase.When_ScrollIntoView_No_VirtualizationGiven_CalendarView.When_NextMonth_InQuickSequence
Need separate investigation (NOT excluded — may be real product bugs / WASM-only coverage):
Given_TextBox.When_Ctrl_Delete,When_Repeated_Delete_Undo_Redo(edit/undo semantics differ on WASM)Given_FrameworkElement_And_Leak.When_Add_Remove(NavigationView, 15)(WASM GC nondeterminism)Given_AccessibleTextBox.When_Accessibility_Is_Enabled_After_Text_Exists…(WASM-only DOM; async detach)
Separate, larger issue (not flakiness)
The screenshot comparison stage is ~entirely red in every build (~14 of ~2362 pass) — a systemic
stale-baseline / rendering-shift problem requiring a baseline-regeneration decision, tracked separately.
Activity
test: Exclude WASM-Skia render-loop flaky tests (#23524)
nickrandolph commentedon Jun 23, 2026
Validation + residual tail (from PR #23521, build 219522)
After the fixes (CI launch env fix + 12
WaitForhardenings + 6 SkiaWasm exclusions here, plus the 2real-bug exclusions in #23525), the "Tests - WebAssembly Skia" stage now succeeds — it was failing
13+ runtime tests on every recent master build.
The stage now passes via the built-in retry mechanism with a small residual low-frequency tail —
these failed once then passed on retry (vs. 13+ before). Same render-loop / UI-timing class; the
UITestHelper.WaitFor(() => <real post-condition>, timeoutMS: 5000)pattern (andWaitForIdle(waitForCompositionAnimations: true)) applies for incremental hardening as they recur:Given_FrameworkElement_And_Leak.When_Add_Remove(NavigationView, 15)— WASM GC nondeterminism (intentionally not excluded; broad exclusion would drop leak coverage for all controls on WASM).Given_TextBox...When_Caret_Positioning_With_Complex_Transformations— newly surfaced (~1-in-N; not in the 15-build sample)....When_Initial_Focus_With_DefaultButton_Set— newly surfaced....When_MenuFlyout_Item_Uses_Owner_Subtree_Theme_Light_Under_Dark_App— newly surfaced.These are tracked here for incremental hardening rather than batch-excluded — chasing every 1-in-N flake
at once is whack-a-mole, and they aren't reliably reproducible for fail-before/pass-after validation.
nickrandolph commentedon Jun 23, 2026
Residual tail confirmed ENVIRONMENT-related (not real bugs)
Reproduced the three newly-surfaced tail tests in a healthy local WASM browser (real display +
window manager + anti-throttle flags) — the same conditions the CI env fix establishes:
Given_TextBox.When_Caret_Positioning_With_Complex_TransformationsGiven_ContentDialog.When_Initial_Focus_With_DefaultButton_SetGiven_MenuFlyout.When_MenuFlyout_Item_Uses_Owner_Subtree_Theme_Light_Under_Dark_AppSo these are the same render-loop/timing class as the rest of this issue — they pass reliably once
the browser window is real/focused. The CI launch fix (screen + window manager + anti-throttle) is the
correct root-cause fix for the whole class; the few that still flake ~1-in-N are caught by the
stage's retry. No per-test exclusion or hardening is warranted for these — closing the loop on the
tail. (Contrast: the two
TextBoxtests in #23525 fail 6/6 even in a healthy browser → genuine bugs.)nickrandolph commentedon Jun 24, 2026
Whole WASM-Skia tail empirically confirmed environment-class (not buggy)
Reproduced every identified tail test in a healthy local WASM browser (real display + window
manager + anti-throttle — i.e. the conditions the CI env fix establishes). All pass reliably:
Conclusion: the tail tests are correct — the CI browser environment was the defect, fixed at the
root by the launch change (screen + window manager + anti-throttle). The residual ~1-per-run CI flakes
are the env fix not being 100% under heavy parallel agent load, and are absorbed by the stage's retry
(the stage goes green). There is no per-test bug to fix here; in fact
Opens_First_Timeis aflash-detector whose checkpoints must NOT be wrapped in waits (that would mask the very flash it guards).
Remaining residual reduction is a CI-infrastructure matter (browser parallelism / agent resources),
not test code. The two genuinely-buggy WASM TextBox tests are separate (#23525).
Merge pull request #23533 from unoplatform/fix/ci-wasm-skia-flaky-run…
fix(ci): De-flake WASM-Skia runtime tests (env fix + test hardening)
fix(ci): Exclude flaky Repeater ChangeView test on SkiaWasm