Skip to content

When_MsAppData hangs on the Linux Framebuffer runtime-test host under .NET 11 Preview 6 #23967

Open

Description

@Xiaoy312

Current behavior 🐛

Given_BitmapSource.When_MsAppData stalls indefinitely on the Tests - Desktop Skia Linux Framebuffer CI stage (the useXvfb: false variant of build/ci/tests/.azure-devops-tests-linux-skia.yml) whenever CI runs on .NET SDK 11.0.100-preview.6.26359.118. The job is killed at its 60-minute cap, no results xml is written, and the downstream PublishTestResults / Publish Failed Tests Results tasks fail as a consequence.

The log always ends the same way — the test starts and nothing follows for ~52 minutes:

2026-08-03T15:57:12.3894852Z       Running test When_MsAppData()
2026-08-03T16:48:56.2564868Z ##[error]The Operation will be canceled. The next steps may not contain expected logs.

Correlated with the .NET 11 Preview 6 bump, over the 40 most recent builds of the Uno.UI - CI pipeline:

host SDK Tests - Desktop Skia Linux Framebuffer
11.0.100-preview.6.26359.118 8 hangs at When_MsAppData, 4 green
10.0.105 21 green, 2 genuine test failures, 1 hang at an unrelated test
  • All 8 failures in that window are the same hang (builds 225359, 225410, 225476, 225493, 225521, 225537, 225713, 225723), plus 225357 just outside it — 9 confirmed by log tail. Zero When_MsAppData hangs on 10.0.105.
  • Bracketed on feature/breakingchanges: last green build 225197 (8d5e55db9f, preview.5) → first red build 225357 (9f5ca5899f, preview.6). The only PR in between is chore: Update to .NET 11 Preview 6 #23776 (the p5 → p6 bump).

It is not a build-configuration difference. The X11 Linux stage and the Framebuffer stage consume the same samplesapp-desktop-skia artifact and run the same script — only useXvfb differs (build/ci/tests/.azure-devops-tests-skia-stages.yml) — and the X11 stage is green on every preview.6 build. It is also specific to the ms-appdata path rather than "headless never raises ImageOpened": the image tests immediately before it (When_BundleImages_Loaded_StreamsAreDisposed, the When_DecodePixel* set, When_ImageBrush_Source_Changes, When_LocalResource_ScaleQualifier) all pass on the same run.

Which of the test's three awaits stalls is still unresolved — StorageFile.GetFileFromApplicationUriAsync, CopyAsync, or the ImageOpened TCS.

Secondary problem: any stall costs a full 60-minute job with zero diagnostics

When_MsAppData (src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Media_Imaging/Given_BitmapSource.cs) awaits a TaskCompletionSource fed only by ImageOpened — there is no ImageFailed handler and no [Timeout]:

TaskCompletionSource<bool> tcs = new();
sut.ImageOpened += (s, e) => tcs.TrySetResult(true);

await tcs.Task;

UnitTestsControl applies a timeout to an async test body only when the method carries an explicit [Timeout] attribute (GetTestTimeout); DefaultUnitTestTimeout guards initialize/cleanup steps via WaitResult, not the test body. So a stalled image load consumes the whole job budget and produces no failure record — whereas an ImageFailed handler plus a [Timeout] would have turned this into a fast, readable failure with an error message pointing at the real cause.

This is worth fixing independently of the runtime cause above, and would make the underlying issue far easier to diagnose.

Expected behavior 🎯

When_MsAppData completes on the Linux Framebuffer host as it does on X11, or fails fast with the ImageFailed error message instead of hanging until the job times out.

How to reproduce it (as minimally and precisely as possible) 🔬

CI-only so far; no app repro project — it reproduces in the repository's own runtime-test suite.

  1. Check out a branch whose CI SDK is 11.0.100-preview.6.26359.118 (build/ci/net11/_global.json), e.g. feature/breakingchanges.
  2. Build the Skia samples app, then run the runtime tests on Linux without X11:
    build/test-scripts/linux-skia-runtime-tests.sh false
  3. The run stalls at Running test When_MsAppData(). With xvfb-run (pass true) the same binary passes.

Reference builds (public pipeline Uno.UI - CI, definition 5): 225723, 225713, 225537 hang; 225197 (preview.5) green.

Workaround 🛠️

Re-running the stage sometimes clears it — all 4 green preview.6 runs were retries (stage attempt 2–3) that executed the full ~7,970-test suite, so those passes are genuine and not an artifact of the failed-tests-only retry path. It is a coin flip, not a fix: builds 225359, 225476 and 225521 hung again on retry.

Renderer 🎨

  • Skia
  • Native

Affected platforms 📱💻🖥️

Desktop (Linux Framebuffer)

Uno.Sdk version (and other relevant versions) 📦

Repository CI, not an app: feature/breakingchanges running .NET SDK 11.0.100-preview.6.26359.118 (build/ci/net11/_global.json). Last known-good SDK for this stage: 11.0.100-preview.5.26302.115. Unaffected on 10.0.105.

IDE version 🧑‍💻

N/A — Azure Pipelines hosted Linux agent.

Anything else we need to know? 💬

The hang blocks the Tests - Desktop Skia Linux Framebuffer stage for every PR targeting a preview.6 branch, so it shows up as an unrelated red stage on otherwise clean PRs.

Two separable fixes:

  1. Root cause — why the ms-appdata BitmapImage load never completes on the non-X11 Linux host under .NET 11 Preview 6.
  2. Test resilience — add an ImageFailed handler (fail with e.ErrorMessage) and a [Timeout] to When_MsAppData, as the neighbouring When_BundleImages_Loaded_StreamsAreDisposed already does for failures. A broader look at whether the runtime-test harness should apply a default timeout to async test bodies (not just init/cleanup) would prevent the whole class of 60-minute job kills.

Activity

  1. added
    triage/untriaged
    on Aug 4, 2026
  2. MartinZikmund commented on Sep 1, 2026

    @MartinZikmund
    Member

    Also reproduces on Skia Android (newly exposed, not new)

    The same hang now shows on the Android Skia runtime-test host. Same signature as the Linux legs — the test starts, then total silence, no ImageOpened, no ImageFailed, no exception:

    09-01 13:10:22.971 I DOTNET :       Running test When_MsAppData()
    09-01 13:10:53.107 I DOTNET :       Retry 1/2 of When_MsAppData() after 36ms: TimeoutException: The operation has timed out.
    

    (The 30 s bound is the containment WaitAsync from this issue doing its job — on Android it fails fast instead of eating the agent.)

    Why it surfaced on 2026-08-31

    It never ran on Android at all before then. #24003 aligned shard 0's UITEST_RUNTIME_TEST_GROUP_COUNT (4 → 5, 005db435370, merged 10:19 UTC). Selection is a stable hash modulo that count, so When_MsAppData was one of the 14.7% of methods no shard selected. Verified absent from every Android shard log in pre-fix builds 231043, 231021, 230963, and present in shard 0 in every post-fix build.

    master still has the old 4, which is why this is invisible there.

    Frequency

    Three unrelated PR builds inside a few hours, all on feature/breakingchanges:

    Build PR Attempt 1 Isolated retries
    231145 #24186 failed passed → green
    231142 #24194 failed failed ×3 → red
    231152 #19083 failed passed → green

    So it is intermittent, and the retry mechanism only sometimes rescues it. Builds 231121 / 231139 / 231157 ran it on Android and passed.

    Diagnostic value for the root cause

    Android narrows the hypothesis space usefully, since it shares almost nothing with the Linux Framebuffer host except the managed stack:

    • It is not headless/windowing-specific — Android has a real surface and a real render loop, yet stalls the same way.
    • It is not Framebuffer-vs-X11 — that framing came from the original bracket, but this is a third, unrelated host.
    • The sibling ms-appdata tests (When_MsAppData_StreamDisposed_FileNotLocked, When_Exif_Rotated_MsAppData) run green on Android in every post-fix build checked. Since When_MsAppData_StreamDisposed_FileNotLocked also does GetFileFromApplicationUriAsync + CopyAsync and then awaits ImageOpened, that points away from the storage calls and toward the ImageOpened path in this specific test — narrowing the "which of the three awaits stalls" question left open in the issue body.

    The most visible difference between them is that the failing one reuses the fixed name ingredient3.png with ReplaceExisting across runs, while the passing one uses a fresh Guid-suffixed name — worth checking whether a cached/locked entry for a previously written path is what never resolves.

    Containment

    #24327 adds SkiaAndroid to the exclusion so unrelated PRs stop going red. Scoped to this test only; the siblings keep running. The underlying bug stays open here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

triage/untriaged

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions