Skip to content

[Tests] Enable SubscribeToAppDomainUnhandledException on CoreCLR#11673

Open
jonathanpeppers wants to merge 1 commit into
dotnet:mainfrom
jonathanpeppers:jonathanpeppers/enable-unhandled-exception-coreclr
Open

[Tests] Enable SubscribeToAppDomainUnhandledException on CoreCLR#11673
jonathanpeppers wants to merge 1 commit into
dotnet:mainfrom
jonathanpeppers:jonathanpeppers/enable-unhandled-exception-coreclr

Conversation

@jonathanpeppers

Copy link
Copy Markdown
Member

Description

MSBuildDeviceIntegration.InstallAndRunTests.SubscribeToAppDomainUnhandledException was previously skipped via Assert.Ignore for both CoreCLR and NativeAOT, with the reason "AppDomain.CurrentDomain.UnhandledException doesn''t work in CoreCLR or NativeAOT".

However, the rest of the test body was already wired up for CoreCLR:

string? expectedSender = runtime switch
{
    AndroidRuntime.MonoVM => "System.Object", // MonoVM passes the current domain as the sender
    AndroidRuntime.CoreCLR => null, // CoreCLR explicitly passes a `null` sender
    _ => throw new NotImplementedException($"Test does not support runtime {runtime}"),
};

…and IgnoreUnsupportedConfiguration(CoreCLR, release: true) already returns false (i.e. CoreCLR + Release is supported).

Change

Tighten the Assert.Ignore block so it only skips on NativeAOT, letting the test exercise AppDomain.CurrentDomain.UnhandledException on CoreCLR. With sender == null, the formatted logcat line becomes # Unhandled Exception: sender=; e.IsTerminating=True; e.ExceptionObject=System.Exception: CRASH, which the existing expectedSender switch already produces.

Test status on main (build 14389667)

Runtime Before After
MonoVM ✅ Passed ✅ Passed
CoreCLR ⏭️ NotExecuted ▶️ Now runs
NativeAOT ⏭️ NotExecuted ⏭️ NotExecuted (still skipped)

The test was previously skipped for both CoreCLR and NativeAOT, but the
expected-sender switch already handled CoreCLR (null sender). Tighten
the Assert.Ignore so the test runs on CoreCLR while still skipping on
NativeAOT.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

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.

Pull request overview

This PR updates the MSBuild device integration test suite to exercise AppDomain.CurrentDomain.UnhandledException on CoreCLR by narrowing an Assert.Ignore guard that previously skipped the test for both CoreCLR and NativeAOT.

Changes:

  • Restrict SubscribeToAppDomainUnhandledException to skip only on AndroidRuntime.NativeAOT.
  • Update the ignore message to reflect the new skip condition.

kotlarmilos added a commit that referenced this pull request Jun 17, 2026
The test body already routes CoreCLR to a null unhandled-exception sender,
so only NativeAOT needs to stay skipped. Aligns with #11673.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants