Repository navigation
Conversation
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-24215/wasm-skia-net9/index.html |
|
|
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-24215/wasm-skia-net9/index.html |
a150533 to
fa2c98f
Compare
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-24215/wasm-skia-net9/index.html |
|
One of the unit test failures is in When_WebMessageReceived(): This is caused by a regression in dotnet/android; see: dotnet/android#12542 |
|
On Discord, Peppers mentioned a possible workaround for dotnet/android#12542: setting Unfortunately, when I try that locally: diff --git a/src/Uno.CrossTargetting.targets b/src/Uno.CrossTargetting.targets
index 925eabe92b..ec17ae78ff 100644
--- a/src/Uno.CrossTargetting.targets
+++ b/src/Uno.CrossTargetting.targets
@@ -104,6 +104,7 @@
-->
<PropertyGroup Condition=" $(IsAndroid) And '$(BundledNETCoreAppPackageVersion)' == '11.0.0-preview.7.26381.103' ">
<MicrosoftNETCoreAppRefPackageVersion>11.0.0-preview.7.26381.103</MicrosoftNETCoreAppRefPackageVersion>
+ <_AndroidTypeMapImplementation>llvm-ir</_AndroidTypeMapImplementation>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' != 'uap10.0.19041' and $(TargetFramework.EndsWith('-windows10.0.19041.0')) != 'true' and '$(TargetPlatformIdentifier)' != 'UAP'">SamplesApp hangs during startup: At present, the suggested workaround doesn't appear to be viable. |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-24215/wasm-skia-net9/index.html |
|
The build 230688 found UI Test snapshots differences: Details
|
ffc0ddc to
7227c51
Compare
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-24215/wasm-skia-net9/index.html |
7227c51 to
964da95
Compare
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-24215/wasm-skia-net9/index.html |
|
The build 230899 found UI Test snapshots differences: Details
|
Fixes: #24208 Issue #24208 notes that the **Tests - Android+NativeAOT Skia > Runtime Tests \*** jobs are all failing, with an apparent on-device *crash*: --------- beginning of crash 08-26 12:10:03.662 4678 4878 F libc : FORTIFY: pthread_mutex_lock called on a destroyed mutex (0x7c447e440768) 08-26 12:10:03.748 525 2499 I ActivityManager : Process uno.platform.samplesapp.skia.nativeaot (pid 4678) has died: fg TOP 08-26 12:10:03.751 356 356 I Zygote : Process 4678 exited cleanly (0) The crash appears to be a red herring; it happens, but it's not actually important. There are two important bits: 1. "Process 4678 exited cleanly (0)" 2. The test results file *exists* but *does not contain results*. Important background on (1) is [`App.HandleRuntimeTests()`][0], which contains: await SampleControl.Presentation.SampleChooserViewModel.Instance.RunRuntimeTests( CancellationToken.None, runtimeTestResultFilePath, () => System.Environment.Exit(0)); In particular, note the 4th line: when `RunRuntimeTests()` finishes, `Environment.Exit(0)` is invoked. This exits the process with exit code 0, which is the cause for `Process 4678 exited cleanly (0)`. If we look at a *runner* test execution log file, e.g. from **Tests - Android+NativeAOT Skia > Runtime Tests 0 > Run Android+NativeAOT Skia Tests**, what appears to be happening is: 1. The tests are started: adb shell pm grant uno.platform.samplesapp.skia.nativeaot android.permission.WRITE_EXTERNAL_STORAGE adb shell pm grant uno.platform.samplesapp.skia.nativeaot android.permission.READ_EXTERNAL_STORAGE adb shell am start -n "uno.platform.samplesapp.skia.nativeaot/scrc6415f86cac20992436.MainActivity" \ -e UITEST_RUNTIME_TEST_GROUP 0 \ -e UITEST_RUNTIME_TEST_GROUP_COUNT 5 \ -e UITEST_RUNTIME_TESTS_FILTER fA== \ -e UITEST_RUNTIME_AUTOSTART_RESULT_FILE /storage/emulated/0/Android/data/uno.platform.samplesapp.skia.nativeaot/files/TestResult-20260826120957.xml 2. On-device, the test runner runs, and successfully creates `TestResult-20260826120957.xml`. When `RunRuntimeTests()` finishes, it exits. 3. The test runner grabs the test results file: adb pull /storage/emulated/0/Android/data/uno.platform.samplesapp.skia.nativeaot/files/TestResult-20260826120957.xml TestResult-20260826120957.xml This is successful; the file exists. 4. `TestResult-20260826120957.xml` is processed to determine if any tests failed: pushd src/Uno.NUnitTransformTool dotnet run fail-empty ../../TestResult-20260826120957.xml 5. `Uno.NUnitTransformTool` is not happy, as no tests are present: The test results file /agent/_work/1/s/build/TestResult-20260826120957.xml does not contain any results The `TestResults*.xml` file *exists*, which is why (3) succeeds. The process exited cleanly. The `FORTIFY: pthread_mutex_lock called on a destroyed mutex` message *looks* important -- it would be *an* explanation for the overall failure of the job -- but *isn't* important, because the part we actually care about -- the creation of `TestResult-20260826120957.xml` -- was successful. The crash didn't hinder that. The *real* question is this: why isn't `Uno.NUnitTransformTool` happy? Why doesn't `TestResults*.xml` contain any results? The partial answer is Native AOT trimming: `RunRuntimeTests()` executes types that have a `[TestClass]` attribute, but the app contains *no* types with `[TestClass]`. (Verified via printf debugging; see comments on #24208). As the test runner is driven by Reflection, looking for types with `[TestClass]` -- types which will *not* be statically referenced by anything else -- then in order for the types to remain after linking, they must be considered roots. Fix this by adding a `@(TrimmerRootAssembly)` entry for `Uno.UI.RuntimeTests`. This causes `Uno.UI.RuntimeTests.dll` to be treated as a "root assembly," preserving all types and members within that assembly. This in turn allows `[TestClass]`-attribute types to be found at runtime, which in turn means `TestResults*.xml` is no longer empty; it contains unit test run information! (Obvious followup question: why did this start mattering with .NET 11 Preview 7? @jonpryor doesn't have a theory for why this previously worked with .NET 11 Preview 6 and earlier…) [0]: https://github.com/unoplatform/uno/blob/ea3418a53ca8a6bae5b8f8bed4075a775746abff/src/SamplesApp/SamplesApp.Shared/App.Tests.cs#L91-L94
964da95 to
878906c
Compare
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-24215/wasm-skia-net9/index.html |
|
The build 231171 found UI Test snapshots differences: Details
|
Many tests on Android+NativeAOT were failing with:
Microsoft.UI.Xaml.Markup.XamlParseException: Failed to parse member
(Unable to find type {using:Uno.UI.Markup}FromJson. If the linker is enabled, more info at https://aka.platform.uno/linker-configuration)
Indeed, `Uno.UI.Markup.FromJsonExtension` was trimmed away from
`Uno.UI.Extras.dll`.
Add `Uno.UI.Extras` to `@(TrimmerRootAssembly)`, which will hopefully
fix the above error.
Context: dotnet/android#12542 Context: #24270 Context: #24271 Ignore the following test, which is a regression in dotnet/android; see also dotnet/android#12542: * Given_WebView2.When_WebMessageReceived() Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException: Timed out waiting for condition to be met. When_WebMessageReceived():476 at Private.Infrastructure.TestServices.WindowHelper.<WaitFor>d__41.MoveNext() --- End of stack trace from previous location --- at Uno.UI.RuntimeTests.Tests.Microsoft_UI_Xaml_Controls.Given_WebView2.<When_WebMessageReceived>d__10.MoveNext() --- End of stack trace from previous location --- at Uno.UI.Samples.Tests.UnitTestsControl.<>c__DisplayClass74_2.<<ExecuteTestsForInstance>g__InvokeTestMethod|5>d.MoveNext() * Given_WebView2.When_WebMessageReceived_After_RemoveAdd(): Hangs on CI, as the test didn't have a `[Timeout]`. Ignore the following test, which is probably some floating-point related issue that needs more investigation; see also #24270: * Given_AnimatedVisualPlayer.When_Reverse_Negative_PlaybackRate_Animation_Completes_At_One(): Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException: Assert.AreEqual failed. Expected a difference no greater than <0.02> between expected value <0.2223382443189621> and actual value <0.25255224108695984>. 'expected' expression: 'frozenProgress', 'actual' expression: 'GetPlayerProgress(player)'. A zero playback rate should freeze the current progress. at Microsoft.VisualStudio.TestTools.UnitTesting.Assert.ThrowAssertAreEqualFailed[T](T expected, T actual, T delta, String userMessage) in //src/TestFramework/TestFramework/Assertions/Assert.AreEqual.cs:line 679 at Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual(Double expected, Double actual, Double delta, String message, String expectedExpression, String actualExpression) in //src/TestFramework/TestFramework/Assertions/Assert.AreEqual.cs:line 1149 at Uno.UI.RuntimeTests.Tests.Microsoft_UI_Xaml_Controls.Given_AnimatedVisualPlayer.When_PlaybackRate_Zero_Keeps_Progress_Stable() at Uno.UI.Samples.Tests.UnitTestsControl.<>c__DisplayClass74_2.<<ExecuteTestsForInstance>g__InvokeTestMethod|5>d.MoveNext() Ignore the following tests, which are failing for reasons @jonpryor doesn't understand; see also #24271: * Given_BitmapSource.When_MsAppData() System.TimeoutException: The operation has timed out. at Uno.UI.RuntimeTests.Tests.Windows_UI_Xaml_Media_Imaging.Given_BitmapSource.<When_MsAppData>d__3.MoveNext() --- End of stack trace from previous location --- at Uno.UI.Samples.Tests.UnitTestsControl.<>c__DisplayClass74_2.<<ExecuteTestsForInstance>g__InvokeTestMethod|5>d.MoveNext() * Given_WebView2.When_LocalFolder_File() Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException: Timed out waiting for condition to be met. When_LocalFolder_File():343 at Private.Infrastructure.TestServices.WindowHelper.<WaitFor>d__41.MoveNext() --- End of stack trace from previous location --- at Uno.UI.RuntimeTests.Tests.Microsoft_UI_Xaml_Controls.Given_WebView2.<<When_LocalFolder_File>g__Do|7_0>d.MoveNext() --- End of stack trace from previous location --- at Uno.UI.RuntimeTests.Helpers.TestHelper.<RetryAssert>d__1.MoveNext() --- End of stack trace from previous location --- at Uno.UI.RuntimeTests.Helpers.TestHelper.<RetryAssert>d__1.MoveNext() --- End of stack trace from previous location --- at Uno.UI.RuntimeTests.Tests.Microsoft_UI_Xaml_Controls.Given_WebView2.<When_LocalFolder_File>d__7.MoveNext() --- End of stack trace from previous location --- at Uno.UI.Samples.Tests.UnitTestsControl.<>c__DisplayClass74_2.<<ExecuteTestsForInstance>g__InvokeTestMethod|5>d.MoveNext()
Context: https://dev.azure.com/uno-platform/1dd81cbd-cb35-41de-a570-b0df3571a196/_apis/build/builds/230688/logs/833 The **Tests - Android+NativeAOT Skia > Runtime Tests 1** job is timing out. While investigating this, I noticed a few oddities in the log output. For starters, the END_TIME value is stupidly high, and is never reached: 2026-08-28T01:20:09.4548273Z + UITEST_TEST_TIMEOUT_AS_MINUTES=2600 2026-08-28T01:20:09.4548976Z + TIMEOUT=156000 2026-08-28T01:20:09.4549296Z + END_TIME=156193 … 2026-08-28T02:01:06.8736188Z + [[ ! -n '' ]] 2026-08-28T02:01:06.8736538Z + [[ 2650 -lt 156193 ]] 2026-08-28T02:01:06.8736787Z + sleep 15 2026-08-28T02:01:08.7396984Z ##[error]The Operation will be canceled. The next steps may not contain expected logs. 2026-08-28T02:01:18.7490909Z ##[error]The operation was canceled. 2026-08-28T02:01:18.7493689Z ##[section]Finishing: Run Android+NativeAOT Skia Tests Notice that END_TIME=156193, but we only ever hit 2650! The "problem" is a "semantic mismatch" between `.azure-devops=tests-android-nativeaot-skia.yml`, which specifies a "units" of seconds: UITEST_TEST_TIMEOUT: '2600s' and `android-run-skia-runtime-tests.sh`, which trims off the unit suffix, and assumes the resulting 2600 is in *minutes*, which it then multiplies by 60 to get 156000 *seconds*. Update `android-run-skia-runtime-tests.sh` to check the last character of `$UI_TEST_TIMEOUT`, and when `s` ("seconds"), use the value as-is. The next observed oddity was around the `while` loop: while [[ ! $($ANDROID_HOME/platform-tools/adb shell test -e "$UITEST_RUNTIME_AUTOSTART_RESULT_DEVICE_PATH" > /dev/null) && $SECONDS -lt $END_TIME ]]; do The log file would contain: 2026-08-28T01:20:09.4553055Z ++ /agent/_work/1/s/build/android-sdk/platform-tools/adb shell test -e /storage/emulated/0/Android/data/uno.platform.samplesapp.skia.nativeaot/files/TestResult-20260828012008.xml 2026-08-28T01:20:09.4684328Z + [[ ! -n '' ]] 2026-08-28T01:20:09.4684990Z + [[ 193 -lt 156193 ]] What's up with `+ [[ ! -n '' ]]`? Because of the `$($ANDROID_HOME/…/adb shell test -e …)`, the `while` loop was implicitly capturing the output of `adb shell test -e`, and comparing that to a non-empty string. (`test -n` is true when the value length is non-zero.) The problem is, `adb shell test -e` *never* prints anything: % adb shell test -e /storage/emulated/0/Android/data/uno.platform.samplesapp.skia.nativeaot/files/TestResult-4.xml % echo $? 0 % adb shell ls -l /storage/emulated/0/Android/data/uno.platform.samplesapp.skia.nativeaot/files/TestResult-4.xml -rw-rw---- 1 u0_a197 ext_data_rw 1399428 2026-08-28 13:28 /storage/emulated/0/Android/data/uno.platform.samplesapp.skia.nativeaot/files/TestResult-4.xml Thus, checking the *output* of `adb shell test -e` for "truthiness" is doomed to fail. Split this up so that the test can actually work: while [[ $SECONDS -lt $END_TIME ]]; do if $ANDROID_HOME/platform-tools/adb shell test -e "$UITEST_RUNTIME_AUTOSTART_RESULT_DEVICE_PATH" ; then break; fi done This still doesn't fix the apparent hang, but it does reduce the headscratching involved when reading the log files…
878906c to
b39b85c
Compare
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-24215/wasm-skia-net9/index.html |
|
The build 231279 found UI Test snapshots differences: Details
|
There was a problem hiding this comment.
Pull request overview
This PR addresses Android+NativeAOT Skia runtime-test execution issues by ensuring the Uno.UI.RuntimeTests assembly is preserved during trimming (so [TestClass] discovery via reflection still works), and by adjusting a few known-problematic runtime tests / runner behavior for NativeAOT scenarios.
Changes:
- Mark
Uno.UI.RuntimeTests(andUno.UI.Extras) as trimmer root assemblies when publishing NativeAOT SamplesApp. - Exclude specific runtime tests on
SkiaAndroidunderRUNTIME_NATIVE_AOTwhere they hang or behave differently. - Fix Android runtime-test runner timeout handling (supports
...sseconds values) and improve result-file wait loop behavior.
Reviewed changes
Copilot reviewed 5 out of 5 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_Media_Imaging/Given_BitmapSource.cs | Excludes a hanging test on Android+NativeAOT by extending platform exclusion logic. |
| src/Uno.UI.RuntimeTests/Tests/Microsoft_UI_Xaml_Controls/Given_WebView2.cs | Adds Android+NativeAOT exclusions for WebView2 tests that hang/fail under AOT trimming/runtime constraints. |
| src/Uno.UI.RuntimeTests/Tests/Microsoft_UI_Xaml_Controls/Given_AnimatedVisualPlayer.cs | Skips a floating-point sensitive test on Android+NativeAOT. |
| src/SamplesApp/SamplesApp/SamplesApp.csproj | Adds @(TrimmerRootAssembly) entries so runtime test assemblies aren’t trimmed away during NativeAOT publish. |
| build/test-scripts/android-run-skia-runtime-tests.sh | Updates timeout parsing to correctly handle second-based timeouts and improves the poll loop for results. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-24215/wasm-skia-net9/index.html |
|
The build 231326 found UI Test snapshots differences: Details
|
|
Tick the box to add this pull request to the merge queue (same as
|
The ms-appdata load intermittently never completes on the Android Skia runtime-test host: the test starts, then 30 seconds of total silence follow with no ImageOpened, no ImageFailed and no exception, until the inner WaitAsync trips. That is the same signature already tracked for the Linux hosts in #23967, which the existing exclusion covers. #24215 already excluded SkiaAndroid for this test, but gated behind RUNTIME_NATIVE_AOT while investigating #24271. The hang is not specific to NativeAOT -- it reproduces on the plain Android Skia leg -- so the exclusion is un-gated here rather than duplicated, and #24271 is kept in the comment. The test only began running on Android at all once #24003 aligned shard 0's UITEST_RUNTIME_TEST_GROUP_COUNT (4 -> 5, 005db43): selection is a stable hash modulo that count, so before the fix When_MsAppData was one of the 14.7% of methods no shard selected. It is not a new failure, just a newly executed one. Since that merge it has failed on three unrelated PR builds within hours of each other -- 231145 (#24186), 231142 (#24194) and 231152 (#19083) -- where the isolated retry only sometimes recovers, so it reddens whichever PR happens to be unlucky. master still carries the old count of 4 and therefore never runs it. Scoped to this test alone: When_MsAppData_StreamDisposed_FileNotLocked and When_Exif_Rotated_MsAppData use the same ms-appdata path and run green on Android in every post-fix build checked, so they keep running. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015Lk1RUZfAj6A7xGWzYaoBw
Fixes: #24208
Issue #24208 notes that the
Tests - Android+NativeAOT Skia > Runtime Tests * jobs are all failing, with an apparent on-device crash:
The crash appears to be a red herring; it happens, but it's not actually important.
There are two important bits:
Important background on (1) is
App.HandleRuntimeTests(), which contains:In particular, note the 4th line: when
RunRuntimeTests()finishes,Environment.Exit(0)is invoked. This exits the process with exit code 0, which is the cause forProcess 4678 exited cleanly (0).If we look at a runner test execution log file, e.g. from Tests - Android+NativeAOT Skia > Runtime Tests 0 > Run Android+NativeAOT Skia Tests, what appears to be happening is:
The tests are started:
On-device, the test runner runs, and successfully creates
TestResult-20260826120957.xml.When
RunRuntimeTests()finishes, it exits.The test runner grabs the test results file:
This is successful; the file exists.
TestResult-20260826120957.xmlis processed to determine if any tests failed:dotnet run fail-empty ../../TestResult-20260826120957.xml
Uno.NUnitTransformToolis not happy, as no tests are present:The
TestResults*.xmlfile exists, which is why (3) succeeds. The process exited cleanly.The
FORTIFY: pthread_mutex_lock called on a destroyed mutexmessage looks important -- it would be an explanation for the overall failure of the job -- but isn't important, because the part we actually care about -- the creation ofTestResult-20260826120957.xml-- was successful. The crash didn't hinder that.The real question is this: why isn't
Uno.NUnitTransformToolhappy? Why doesn'tTestResults*.xmlcontain any results?The partial answer is Native AOT trimming:
RunRuntimeTests()executes types that have a[TestClass]attribute, but the app contains no types with[TestClass]. (Verified via printf debugging; see comments on #24208).As the test runner is driven by Reflection, looking for types with
[TestClass]-- types which will not be statically referenced by anything else -- then in order for the types to remain after linking, they must be considered roots.Fix this by adding a
@(TrimmerRootAssembly)entry forUno.UI.RuntimeTests. This causesUno.UI.RuntimeTests.dllto be treated as a "root assembly," preserving all types and members within that assembly. This in turn allows[TestClass]-attribute types to be found at runtime, which in turn meansTestResults*.xmlis no longer empty; it contains unit test run information!(Obvious followup question: why did this start mattering with .NET 11 Preview 7? @jonpryor doesn't have a theory for why this previously worked with .NET 11 Preview 6 and earlier…)
GitHub Issue: closes #24208
PR Type:
🏗️ Build or CI related changes
What changed? 🚀
PR Checklist ✅
Screenshots Compare Test Runresults.