Repository navigation
[TrimmableTypeMap] Resolve all TrimmableIgnore, SSL, and Java.Interop-Tests exclusions #11099
Description
Activity
- addedneeds-triageIssues that need to be assigned.Issues that need to be assigned.
on Apr 9, 2026 - addedArea: CoreCLRIssues that only occur when using CoreCLR.Issues that only occur when using CoreCLR.copilot`copilot-cli` or other AIs were used to author this`copilot-cli` or other AIs were used to author thisand removedneeds-triageIssues that need to be assigned.Issues that need to be assigned.
on Apr 9, 2026 - removed a parent issue
on May 5, 2026 - added a commit that references this issue
on May 21, 2026 Status update from
origin/main(ec8c61e1b): several items in the original issue are already fixed or have moved to narrower follow-up tracking.Original checklist status
-
Remove
TrimmableIgnorecategory — all 3 tests pass / are re-enabledTrimmableIgnoreno longer appears onorigin/main.JnienvTest.NewOpenGenericTypeThrowsis enabled; the open-generic activation guard landed via [TrimmableTypeMap] Reject open generic JNI construction #11273 rather than the earlier closed [Mono.Android] Throw NotSupportedException for open generic type activation #11093.JnienvTest.ActivatedDirectThrowableSubclassesShouldBeRegisteredis enabled; UCO constructor activation fixes landed via [TrimmableTypeMap] Fix UCO constructor activations #11094 and later [TrimmableTypeMap] Fix UCO constructor activation #11275.JavaObjectExtensionsTests.JavaCast_BaseToGenericWrapperis enabled; JavaCast/JavaAs + container support landed via [TrimmableTypeMap] JavaCast/JavaAs + container support #11225.
-
Remove
SSLexclusion — all SSL tests are no longer excluded from the CoreCLRTrimmable lane- The CoreCLRTrimmable package-test lane now builds with
-p:_AndroidTypeMapImplementation=trimmable -p:UseMonoRuntime=falseand does not addSSLtoExcludeCategories. SSLcategories still exist on the tests themselves, and NativeAOT still excludesSSL, but that is separate from this trimmable typemap issue.
- The CoreCLRTrimmable package-test lane now builds with
-
Remove or reduce
ExcludedTestNames— Java.Interop-Tests fixtures run without SIGABRT- This has been reduced substantially. The original Java.Interop exact-name exclusions listed in this issue are no longer present except for
Java.InteropTests.InvokeVirtualFromConstructorTests. - Current trimmable
ExcludedTestNamesonorigin/mainare:Java.InteropTests.InvokeVirtualFromConstructorTestsXamarin.Android.RuntimeTests.CustomWidgetTests.InflateCustomView_ShouldNotLeakGlobalRefs
- The Java.Interop exclusion inventory/follow-up is now tracked by [TrimmableTypeMap] Trimmable typemap test exclusions inventory #11170.
- This has been reduced substantially. The original Java.Interop exact-name exclusions listed in this issue are no longer present except for
-
Full parity: trimmable CoreCLR passes all tests that legacy CoreCLR passes
- Not done yet while the remaining exact-name exclusions exist.
Plan to fully close this issue
-
Decide the disposition for
Java.InteropTests.InvokeVirtualFromConstructorTests.- Current comments in
NUnitInstrumentation.cssay this fixture depends on[JniAddNativeMethodRegistrationAttribute], which is unsupported by design under the trimmable typemap; [TrimmableTypeMap] Refuse [JniAddNativeMethodRegistrationAttribute] with XA4251 #11274 made this an explicit XA4251 error. - If that is the intended product behavior, this probably should remain as a documented unsupported scenario and be removed from this issue's closure criteria, with [TrimmableTypeMap] Trimmable typemap test exclusions inventory #11170 retaining the inventory context.
- If we still want test parity here, the work is to provide a trimmable-compatible replacement path for that test scenario rather than making
[JniAddNativeMethodRegistrationAttribute]work under trimmable.
- Current comments in
-
Investigate and fix
Xamarin.Android.RuntimeTests.CustomWidgetTests.InflateCustomView_ShouldNotLeakGlobalRefs.- This is now the only remaining non-Java.Interop exact-name exclusion in the CoreCLRTrimmable runtime test instrumentation.
- Reproduce with a Release CoreCLRTrimmable
Mono.Android.NET-Testsrun, compare against legacy CoreCLR, and inspect the custom view inflation/activation path for the leaked global ref.
-
After those two exclusions are resolved or explicitly accepted as non-goals, remove the remaining
ExcludedTestNamesentries guarded byRuntimeFeature.TrimmableTypeMap. -
Run the full
Mono.Android.NET-TestsCoreCLRTrimmable lane and compare against the normal CoreCLR lane. If there are no additional trimmable-only exclusions/failures, this issue can be closed.
-
Decision update:
-
Java.InteropTests.InvokeVirtualFromConstructorTestsshould remain permanently excluded for the trimmable typemap. This fixture depends on[JniAddNativeMethodRegistrationAttribute], which is unsupported by design under trimmable and now emits XA4251. We should treat this as a documented known limitation unless there is a customer request to implement a fully trimmable-compatible replacement path. -
Xamarin.Android.RuntimeTests.CustomWidgetTests.InflateCustomView_ShouldNotLeakGlobalRefsis not related to the trimmable typemap and should not be an exact-name trimmable exclusion. I opened [tests] Remove custom widget trimmable exclusion #11483 to remove it fromNUnitInstrumentation.cs. The test still has its normal test-level disposition, so any remaining global-ref-leak work should be handled independently of this trimmable typemap parity issue.
-
- added a commit that references this issue
on May 26, 2026 - locked and limited conversation to collaborators
on Jun 26, 2026
Summary
Several tests are excluded when running
Mono.Android.NET-Testswith_AndroidTypeMapImplementation=trimmable. Each exclusion needs investigation and a proper fix to achieve full test parity with the legacy llvm-ir typemap.TrimmableIgnore category (3 tests)
These tests pass with legacy CoreCLR but fail/behave differently with the trimmable typemap:
1.
JnienvTest.NewOpenGenericTypeThrowsStatus: Fix in progress — PR #11093 adds an
IsGenericTypeDefinitionguard inStartCreateInstance. Once merged, this test should be re-enabled.2.
JnienvTest.ActivatedDirectThrowableSubclassesShouldBeRegisteredStatus: Fix in progress — PR #11094 adds
ActivatePeerFromJavaConstructorwhich calls the matching managed ctor for()Vsignatures. Once merged, this test should be re-enabled.3.
JavaObjectExtensionsTests.JavaCast_BaseToGenericWrapperStatus: Needs investigation. The test casts a
JavaListtoJavaList<object>usingJavaCast. The trimmable typemap may not handle generic type casting correctly.SSL category (~20 tests)
SSL tests (
ServerCertificateCustomValidationCallback_*,HttpsShouldWork, etc.) are excluded with theSSLcategory. These need investigation — they may already be fixed by:IHostnameVerifierInvokerAlwaysAcceptingHostnameVerifierOnce those PRs merge, re-run SSL tests with trimmable and remove the exclusion if they pass.
ExcludedTestNames (6 fixtures, ~42 tests)
These Java.Interop-Tests fixtures are excluded because they crash with SIGABRT (
ClassNotFoundException) — the JCW Java classes forJavaObjectsubclasses are not generated by the trimmable build process:Java.InteropTests.JavaObjectTestJava.InteropTests.InvokeVirtualFromConstructorTestsJava.InteropTests.JniPeerMembersTestsJava.InteropTests.JniTypeManagerTestsJava.InteropTests.JniValueMarshaler_object_ContractTestsJava.InteropTests.JavaExceptionTests.InnerExceptionIsNotAProxyRoot cause
These fixtures use
JavaObjecttypes (Java.Interop's direct JNI wrapper, notJava.Lang.Object). Their JCW Java classes (e.g.,net.dot.jni.test.JavaDisposedObject) are generated by the standalone Java.Interop-Tests build and compiled intoMono.Android-Test-classes.jar. However, the trimmable JCW generator only processesJava.Lang.Objectsubclasses —JavaObjectsubclasses are outside the Android type map system.Possible fix
Include the standalone Java.Interop JCW output in the trimmable APK build, or have the trimmable
GenerateTrimmableTypeMaptask also processJavaObjectsubclasses when detected in the test assembly.Definition of done
TrimmableIgnorecategory — all 3 tests passSSLexclusion — all SSL tests passExcludedTestNames— Java.Interop-Tests fixtures run without SIGABRT