Skip to content

fix: Stabilize WinUI runtime tests on master - #26205

Merged
MartinZikmund merged 5 commits into
masterfrom
dev/mazi/winui-rtf-mousemove-tests
Nov 7, 2026
Merged

MartinZikmund merged 5 commits into
masterfrom
dev/mazi/winui-rtf-mousemove-tests

Conversation

@MartinZikmund

@MartinZikmund MartinZikmund commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

GitHub Issue: closes #26204

PR Type:

🏗️ Build or CI related changes

What changed? 🚀

Three tests fail on the WinUI Runtime Tests leg. They have two unrelated causes.

RTF stream tests: CI stopped testing the SDK we reference. They fail on every run since #26106. SamplesApp's MSIX became framework-dependent with MinVersion="2.4.0.0", so Windows binds it to the newest runtime on the machine. On the agent that's 2.6.4, not the referenced 2.4.0. Its WinUIEdit.dll is a different build, and the trailing NUL of RTF output is inverted:

Document WinAppSDK 2.4.0 (tests expect) Runtime 2.6.x (Riched20 12.6.0005)
Empty ...\r\n\0 ...\r\n
Non-empty ...\r\n ...\r\n\0

The tests are right for the version we reference, so they stay as they are. SamplesApp now sets WindowsAppSDKSelfContained to true on the WinAppSDK target, so WinUI runs on 2.4.0 again and can't drift when the agent image changes.

When_MouseMove_PointerEventsAreRaised: test bug. Flaky before #26106 too, failing 5 of the 29 full WinUI runs I sampled. WinUI delivers injected moves asynchronously and coalesces them: ten injected moves arrived as one update. The first update over an element raises only PointerEntered, so if just one lands on the border, PointerMoved never comes, however long the test waits. It now moves in, waits for PointerEntered, then moves again and waits for PointerMoved.

Mouse helper. The WinAppSDK path computed (rect.Left + x) * scale, scaling a window offset that's already physical. At 250% the move landed about 66 DIPs past its target, so this test could never be validated on a scaled display. No effect at 100%, where CI runs. Finger.At has the same bug and is left for #25012.

Given_ScrollViewer_Zoom: test bug. When_ChangeView_With_ZoomFactor and When_Zoom_Respects_MinZoomFactor flake on WinUI, because the zoom is applied asynchronously and WaitForIdle can still read the old factor. The tests next to them are already excluded on WinUI for this reason. They now poll for the expected factor, and When_Zoom_Respects_MaxZoomFactor, which has the same pattern, does too.

Linux snapshot segfault: IdleFrameProbe skipped in snapshots. The snapshot run started crashing on exit (code 139) once #25995 merged. Of the Linux runs sampled, 24 of 44 with #25995 crashed, against 0 of 64 without. All screenshots are already written when it happens. #25995 also added this diagnostic sample, apparently by accident, so skipping it is the first thing to try, but the native crash itself isn't understood: the numbers can't separate the probe from the rest of #25995. The first CI run with the sample skipped (build 244534) didn't crash, but one clean run isn't proof at a 55% crash rate. The sample stays available, and its author may want to remove it along with the unused RenderDocCapture.cs.

Not fixed here: When_Touch_Selection_*_Does_Not_Lock_ScrollViewer. This flake also fails Windows and macOS desktop legs on master and unrelated PRs. The caret loses its thumbs during the drag. It didn't reproduce locally, so the cause is still open and these legs may need a re-run.

Worth a look from reviewers. This takes back the side effect #26106 called out, where this lane was the first real run of a framework-dependent app. The SDK change itself stays. It did launch and run there: both framework-dependent builds ran all 6736 tests, with only these failures. A dedicated framework-dependent smoke test could be a follow-up. On the next bump to 2.6+, the two RTF tests will fail for a real reason, and RichEditBox's RTF save will need to follow.

Validation

  • Runtime, WinUI, framework-dependent (before): both RTF tests fail locally, bound to 2.6.x. The mouse test fails all three attempts. A longer wait alone didn't fix it.
  • Runtime, WinUI, self-contained (after): Given_InputInjector + Given_RichEditBox 532 passed, 0 failed, 102 skipped. The mouse test then passed 3 more runs, no retries. These ran at 250%.
  • Runtime, Skia Desktop: the mouse test passed 2 of 2 runs.
  • Runtime, Skia Desktop, Given_ScrollViewer_Zoom: 15 of 15 passed, 3 runs.
  • Runtime, CI (build 244534): all legs passed on the first attempt, including WinUI at 100% with 0 failed tests. The touch selection flake didn't fire in this run.
  • Compile: local builds used UnoFastDevBuild=true, so analyzers run only on CI.

PR Checklist ✅

🤖 Generated with Claude Code

https://claude.ai/code/session_01TXMNu1pmTF7nEsciGTG9rw

MartinZikmund and others added 3 commits November 7, 2026 15:09
The window rect is already in physical pixels, so scaling it again sent
injected moves off target on displays above 100%. See #25012.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TXMNu1pmTF7nEsciGTG9rw
A framework-dependent MSIX binds to the newest runtime on the agent, so
parity tests ran against 2.6.4 rather than the referenced 2.4.0. Refs #26204.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TXMNu1pmTF7nEsciGTG9rw
WinUI coalesces injected moves and the first update over an element only
raises PointerEntered, so a single burst may never raise PointerMoved.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TXMNu1pmTF7nEsciGTG9rw
Copilot AI balanced review requested due to automatic review settings November 7, 2026 14:09
@MartinZikmund MartinZikmund self-assigned this Nov 7, 2026
@github-actions github-actions Bot added the area/automation Categorizes an issue or PR as relevant to project automation label Nov 7, 2026
@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 15s —— View job


Review of PR #26205

Verdict: ship. I found no blocking issues, so I posted no inline comments.

Issues by severity: 0 blocking, 0 major, 0 minor.

I read the diff and the surrounding test code. I did not build or run anything, so this is a code review only. The runtime validation in the PR description is the author's.

What I checked

  • SamplesApp.csproj: Setting WindowsAppSDKSelfContained=true only when _Platform == 'windows' matches the stated goal of running WinUI tests on the referenced SDK. The RTF test expectations stay unchanged, as the PR argues they should.
  • Mouse.cs: GetWindowRect returns physical pixels, so rect.Left + x * scale correctly scales only the DIP offset. This has no effect at 100% scale, where CI runs.
  • Given_InputInjector.cs: The WaitFor helper resolves through using static ...WindowHelper, and enteredCount and movedCount are captured correctly. Waiting for PointerEntered before the second move fits the coalescing behavior the PR describes. The 3000 ms timeouts look reasonable.

Cross-cutting notes

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.

🟢 Approval recommended

There are no active review issues blocking approval of the runtime-test stabilization changes.

No open issues 🎉

What changed in this PR

Stabilizes the native WinUI runtime-test lane for #26204 by preventing Windows App Runtime version drift and making mouse-event checks deterministic. The SDK’s framework-dependent packaging default from #26106 remains unchanged.

Changes:

  • Makes SamplesApp’s Windows target self-contained so tests use the referenced Windows App SDK.
  • Waits for PointerEntered before injecting the move expected to raise PointerMoved.
  • Corrects mouse-coordinate scaling on high-DPI displays.
File Description
src/​Uno.UI.RuntimeTests/​Windows/​UI/​Input/​Preview/​Injection/​Given_InputInjector.cs Sequences injected moves using bounded pointer-event waits.
src/​Uno.UI.Extras/​DevTools/​Input/​Mouse.cs Scales pointer offsets without rescaling the physical window origin.
src/​SamplesApp/​SamplesApp/​SamplesApp.csproj Bundles the referenced Windows App SDK for the WinUI test host.

Review effort: Balanced

@unodevops

Copy link
Copy Markdown
Contributor

🤖 Your WebAssembly Sample App stage site is ready! Visit it here:

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 244533 found UI Test snapshots differences: skia-linux-screenshots: 2458, skia-windows-screenshots: 2458

Details
  • skia-linux-screenshots: 2458 changed over 2496

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AnimatedBackVisualSourceSamplePage.png
    • AnimatedVisualsTestbedPage.png
    • Application_DispatcherShutdownMode.png-dark
    • AppWindowPresenters.png
    • Arrange_Performance01.png
    • AuthenticationBroker_Cancel.png
    • AutoSizedPathCentered.png-dark
    • AutoSizedTopLeft.png
    • AutoSuggestBox_Keyboard.png-dark
    • AutoSuggestBox_Keyboard.png
    • BasicAutoSuggestBox.png-dark
    • BasicAutoSuggestBox.png
    • Battery.png-dark
    • Battery.png
    • BenchmarkDotNet.png-dark
    • BenchmarkDotNet.png
    • BitmapImage_vs_SvgImageSource.png-dark
    • BitmapImage_vs_SvgImageSource.png
    • BorderRightwithmargins.png-dark
    • BorderRightwithmargins.png
  • skia-windows-screenshots: 2458 changed over 2496

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Accessibility_ScreenReader.png-dark
    • AndroidWindowInsets.png-dark
    • AndroidWindowInsets.png
    • AnimatedBackVisualSourceSamplePage.png
    • AnimatedVisualsTestbedPage.png-dark
    • AppBarButtonWithIconTest.png
    • AppBarToggleButtonTest.png-dark
    • ApplicationViewMode.png-dark
    • ApplicationViewSpanningRectsPage.png
    • Application_DispatcherShutdownMode.png-dark
    • AppWindowPositionAndSize.png
    • AppWindowPresenters.png-dark
    • Attributed_text_Simple.png-dark
    • Attributed_text_Simple.png
    • AutoBorderStretchwithbottommargin.png-dark
    • AutoBorderStretchwithbottommargin.png
    • AutomationProperties_Landmark.png-dark
    • AutomationProperties_Landmark.png
    • AutoSuggestBox_BitmapIcon.png-dark
    • AutoSuggestBox_BitmapIcon.png

MartinZikmund and others added 2 commits November 7, 2026 16:41
WinUI applies ChangeView zoom asynchronously, so reading ZoomFactor after
WaitForIdle can still see the old value.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TXMNu1pmTF7nEsciGTG9rw
Linux snapshot runs began segfaulting on exit once #25995 added this
diagnostic sample: 24 of 44 runs since, 0 of 64 before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TXMNu1pmTF7nEsciGTG9rw
Copilot AI balanced review requested due to automatic review settings November 7, 2026 15:41
@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 13s —— View job


Review of PR #26205

Verdict: ship. I posted no inline comments.

Issues by severity: 0 blocking, 0 major, 1 minor.

This is a code review only. I did not build or run anything, so the runtime validation in the description is the author's.

Checked

  • SamplesApp.csproj: WindowsAppSDKSelfContained=true is scoped to _Platform == 'windows', which matches the goal of running the WinUI lane on the referenced SDK. The RTF expectations stay unchanged.
  • Mouse.cs: GetWindowRect returns physical pixels, so rect.Left + x * scale scales only the DIP offset. It has no effect at 100%.
  • Given_InputInjector.cs: waiting for PointerEntered before the second move fits the coalescing behavior described. The 3000 ms timeouts are bounded and each wait has a message.
  • Given_ScrollViewer_Zoom.cs: polling for the expected ZoomFactor replaces a bare WaitForIdle. The using System; is needed for Math, and the Asserts still run afterwards.
  • IdleFrameProbe.cs: IgnoreInSnapshotTests = true is appropriate for a diagnostic sample.

Cross-cutting notes

  • Minor: the Given_ScrollViewer_Zoom polling and the IdleFrameProbe snapshot exclusion are not mentioned in the PR description, which covers only the RTF, mouse test and Mouse helper changes. A line in the description would help future readers.
  • The UI snapshot comparison reports 2458 of 2496 images changed on both Linux and Windows. That is almost every image, so it looks like a baseline or infrastructure problem rather than something these changes could cause. No UI code in the diff touches rendering. Please confirm it also appears on other PRs from master.
  • Self-contained mode means this lane no longer exercises the framework-dependent MSIX path from fix(sdk)!: Bundle WinAppSDK only in unpackaged heads #26106. The description already suggests a smoke test as a follow-up.
  • Finger.At still has the scale bug (left for MUX runtime-test input helpers (click, tap injection, keyboard) don't work on the WinAppSDK leg #25012). A tracking comment at that spot would help.
  • After an SDK bump to 2.6 or later, the two RTF tests will fail for a real reason, as the description notes.

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.

🔵 Needs a closer look

The Linux exit-time segfault remains unexplained, and skipping IdleFrameProbe is an unverified mitigation requiring human review of Linux snapshot CI results and crash evidence.

No open issues 🎉

Review effort: Balanced

@unodevops

Copy link
Copy Markdown
Contributor

🤖 Your WebAssembly Sample App stage site is ready! Visit it here:

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 244534 found UI Test snapshots differences: skia-linux-screenshots: 2458, skia-windows-screenshots: 2458

Details
  • skia-linux-screenshots: 2458 changed over 2494

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AndroidWindowInsets.png-dark
    • AppBarButtonTest.png
    • AppBar_KeyBoard.png
    • ApplicationViewSpanningRectsPage.png
    • AppWindowPositionAndSize.png-dark
    • ArcSegment.png-dark
    • Attributed_text_Simple.png
    • AuthenticationBroker_Demo.png-dark
    • AutoBorderStretchwithleftmargin.png
    • AutoBorderStretchwithrightmargin.png-dark
    • AutomationProperties_Name.png-dark
    • AutomationProperties_Name.png
    • AutoSuggestBoxChosenSuggestion.png-dark
    • AutoSuggestBoxChosenSuggestion.png
    • AutoSuggestBox_Description.png-dark
    • AutoSuggestBox_Description.png
    • AutoSuggestBox_SoftKeboard.png-dark
    • AutoSuggestBox_SoftKeboard.png
    • Basics Pivot Test.png-dark
    • Basics Pivot Test.png
  • skia-windows-screenshots: 2458 changed over 2494

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Accessibility_ScreenReader.png
    • AnimatedBackVisualSourceSamplePage.png
    • AnimatedVisualsTestbedPage.png-dark
    • AppBarButtonWithIconTest.png
    • AppBar_KeyBoard.png
    • Application_DispatcherShutdownMode.png-dark
    • AppWindowPositionAndSize.png
    • ArcSegment.png
    • AuthenticationBroker_Cancel.png-dark
    • AuthenticationBroker_Cancel.png
    • AutomationProperties_Landmark.png
    • AutomationProperties_Name.png-dark
    • AutoSuggestBoxChosenSuggestion.png
    • AutoSuggestBox_BitmapIcon.png-dark
    • AutoSuggestBox_SoftKeboard.png-dark
    • AutoSuggestBox_SoftKeboard.png
    • Basics_Automated.png-dark
    • Basics_Automated.png
    • BeginTime_MultipleAnimations.png-dark
    • BeginTime_MultipleAnimations.png

@MartinZikmund
MartinZikmund merged commit 968398d into master Nov 7, 2026
59 checks passed
@MartinZikmund
MartinZikmund deleted the dev/mazi/winui-rtf-mousemove-tests branch November 7, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/automation Categorizes an issue or PR as relevant to project automation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WinUI runtime tests fail on master: RTF stream tests and When_MouseMove

4 participants