Repository navigation
[Tests] Re-enable unhandled exception event test on NativeAOT - #13681
Conversation
NativeAOT raises AppDomain.CurrentDomain.UnhandledException for fatal\nmanaged exceptions, but the device test remains skipped and its expected\nsender switch does not include NativeAOT. Remove the skip and expect its\nnull sender. Select the test target device so installation and launch use\nthe same emulator as logcat in multi-device runs. Context: #9784 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the update restoring NativeAOT unhandled-exception test coverage.
No open issues 🎉
What changed in this PR
Restores NativeAOT coverage for AppDomain.CurrentDomain.UnhandledException in the device integration tests, addressing a remaining item in #9784.
Changes:
- Removes the NativeAOT test skip.
- Expects a null event sender for both CoreCLR and NativeAOT.
- Selects the default target device so installation, launch, and logcat use the same device.
| File | Description |
|---|---|
| tests/MSBuildDeviceIntegration/Tests/InstallAndRunTests.cs | Re-enables the NativeAOT exception-event test, updates the sender expectation, and aligns device targeting. |
Review effort: Balanced
The expected sender is null for both supported runtimes, so interpolating a runtime switch adds no value. Match the logcat output directly. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
CI triage for build 1692357: the build is red (31 jobs passed, 5 failed), but the failures do not appear related to this PR. The re-enabled This matches #13644. PR #13666, which updates the package pin to |
The rebase onto cc7cbf6 kept the pre-rebase MSTest conversions of files that main had changed since aa688ac, which reverted those changes and broke the build. For each affected file, convert main's old and new NUnit versions with the same converter and merge the difference into the MSTest file: * cca255c (#13592): drop the Android lint tests and assertions. * 5b32fb1 (#13602): add RelativeDirectoriesUseProjectDirectory and the -mt CollectNonEmptyDirectories coverage. * 78ef747 (#13655): add OpenGenericProxiesKeepTheReflectionActivationConstructor. * 18b8940 (#13585): add the generator nullability/obsolete tests. * dcbd008 (#13580): add the AmbiguousFunctionMetadata_* tests. * 667e27a (#13621): add the sdkmanager package ID tests. * 5ecb8f7 (#13614): drop RunWithLoggingEnablesManagedTimingLogger. * 8287b17 (#13680), 4bfcc92 (#13681): restore the re-enabled tests and removed TODOs. * 5d81a0f (#13666): expect platform-tools 37.0.3. * 8442c75 (#13601): assert the pulled device TRX is deleted. Also drop the EnableNUnitRunner/OutputType lines that 857f463 (#13563) added to Xamarin.Android.Build.Tests and MSBuildDeviceIntegration; MSTestReferences.projitems sets both. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Context: #9784
NativeAOT raises
AppDomain.CurrentDomain.UnhandledExceptionfor fatal managed exceptions, but its case inSubscribeToAppDomainUnhandledExceptionis still skipped. Remove the skip and expect the null sender observed on NativeAOT. Select the test target device so installation and launch use the same emulator as logcat when multiple devices are attached.Validation
make prepare CONFIGURATION=Debug— passed.git submodule update --init external/android-api-docs— initialized the missing documentation input; thenmake leeroy CONFIGURATION=Debug MSBUILD_ARGS='-m:4'passed../dotnet-local.sh build tests/MSBuildDeviceIntegration/MSBuildDeviceIntegration.csproj -c Debug -m:4 -v:minimal— passed, 0 warnings and 0 errors.ADB_TARGET='-s emulator-5556' TEST_ANDROID_SDK_PATH=/Users/simon/android-toolchain/sdk TEST_ANDROID_NDK_PATH=/Users/simon/android-toolchain/ndk TEST_ANDROID_JDK_PATH=/Users/simon/android-toolchain/jdk-25 ./dotnet-local.sh test bin/TestDebug/MSBuildDeviceIntegration/net11.0/MSBuildDeviceIntegration.dll --filter 'Name~SubscribeToAppDomainUnhandledException' --logger 'trx;LogFileName=unhandled-exception-targeted.trx' --results-directory /Users/simon/.copilot/session-state/fc846f78-0f7c-4683-81de-7ee126758efb/files/test-results— passed, 2 tests (CoreCLR and NativeAOT), 0 failed, 0 skipped on an API 35 arm64 emulator.