Skip to content

[TrimmableTypeMap] Resolve all TrimmableIgnore, SSL, and Java.Interop-Tests exclusions #11099

@simonrozsival

Description

@simonrozsival

Summary

Several tests are excluded when running Mono.Android.NET-Tests with _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.NewOpenGenericTypeThrows

Status: Fix in progress — PR #11093 adds an IsGenericTypeDefinition guard in StartCreateInstance. Once merged, this test should be re-enabled.

2. JnienvTest.ActivatedDirectThrowableSubclassesShouldBeRegistered

Status: Fix in progress — PR #11094 adds ActivatePeerFromJavaConstructor which calls the matching managed ctor for ()V signatures. Once merged, this test should be re-enabled.

3. JavaObjectExtensionsTests.JavaCast_BaseToGenericWrapper

Status: Needs investigation. The test casts a JavaList to JavaList<object> using JavaCast. The trimmable typemap may not handle generic type casting correctly.

SSL category (~20 tests)

SSL tests (ServerCertificateCustomValidationCallback_*, HttpsShouldWork, etc.) are excluded with the SSL category. These need investigation — they may already be fixed by:

Once 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 for JavaObject subclasses are not generated by the trimmable build process:

  • Java.InteropTests.JavaObjectTest
  • Java.InteropTests.InvokeVirtualFromConstructorTests
  • Java.InteropTests.JniPeerMembersTests
  • Java.InteropTests.JniTypeManagerTests
  • Java.InteropTests.JniValueMarshaler_object_ContractTests
  • Java.InteropTests.JavaExceptionTests.InnerExceptionIsNotAProxy

Root cause

These fixtures use JavaObject types (Java.Interop's direct JNI wrapper, not Java.Lang.Object). Their JCW Java classes (e.g., net.dot.jni.test.JavaDisposedObject) are generated by the standalone Java.Interop-Tests build and compiled into Mono.Android-Test-classes.jar. However, the trimmable JCW generator only processes Java.Lang.Object subclasses — JavaObject subclasses 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 GenerateTrimmableTypeMap task also process JavaObject subclasses when detected in the test assembly.

Definition of done

  • Remove TrimmableIgnore category — all 3 tests pass
  • Remove SSL exclusion — all SSL tests pass
  • Remove or reduce ExcludedTestNames — Java.Interop-Tests fixtures run without SIGABRT
  • Full parity: trimmable CoreCLR passes all tests that legacy CoreCLR passes

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: CoreCLRIssues that only occur when using CoreCLR.copilot`copilot-cli` or other AIs were used to author thistrimmable-type-map

    Type

    No fields configured for Epic.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions