Repository navigation
[TrimmableTypeMap] Trimmable typemap test exclusions inventory #11170
Description
Summary
The trimmable typemap (_AndroidTypeMapImplementation=trimmable) has 48 tests that are currently excluded because they fail due to fundamental trimmable-typemap limitations. They are excluded by exact name in NUnitInstrumentation.cs, guarded by RuntimeFeature.TrimmableTypeMap, so they only apply to trimmable builds.
The goal is to fix these one by one and remove each exclusion as it's resolved.
All failures share common root causes: the trimmable typemap does not generate Java-side classes for types in Java.Interop-Tests that use JavaObject (not Java.Lang.Object) or rely on net.dot.jni.test.* / net.dot.jni.internal.* Java classes, and some runtime behaviors differ (wrong exception types, missing proxy resolution, etc.).
How to reproduce
make prepare && make all CONFIGURATION=Release
./dotnet-local.sh build tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csproj \
-t:RunTestApp -c Release \
-p:_AndroidTypeMapImplementation=trimmable \
-p:UseMonoRuntime=falseResults: 859 passed, 48 excluded, 10 ignored (by NativeTypeMap/Export/CoreCLRIgnore/NTLM — not trimmable-specific).
To see the raw failures, temporarily remove the ExcludedTestNames block from NUnitInstrumentation.cs.
❌ Missing Java classes (5 tests)
| Test(s) | Count | Missing Class | Error |
|---|---|---|---|
JavaObjectTest.DisposeAccessesThis |
1 | net.dot.jni.test.GetThis |
Cannot register native members |
InvokeVirtualFromConstructorTests.* |
3 | net.dot.jni.test.CallVirtualFromConstructorDerived |
NoClassDefFoundError |
JniTypeManagerTests.CannotCreateGenericHolderFromJava |
1 | net.dot.jni.test.GenericHolder |
Returns null instead of throwing NotSupportedException |
❌ JavaProxyObject / JavaProxyThrowable not available (24 tests)
| Test(s) | Count | Error |
|---|---|---|
JavaObjectArray_object_ContractTest.* |
16 | TestFixtureSetUp Failed — JavaProxyObject native member registration fails |
JniValueMarshaler_object_ContractTests.* (Create*, SpecificTypesAreUsed) |
7 | NoClassDefFoundError: net.dot.jni.internal.JavaProxyObject |
JavaExceptionTests.InnerExceptionIsNotAProxy |
1 | Proxy throwable creation fails |
❌ Proxy resolution / trimmer gaps (4 tests)
| Test | Error |
|---|---|
JniValueMarshaler_IJavaPeerable_ContractTests.*.CreateGenericValue |
No JavaPeerProxy for java/lang/Object with IJavaPeerable target |
JniValueMarshaler_IJavaPeerable_ContractTests.*.CreateValue |
No JavaPeerProxy for java/lang/Object with IJavaPeerable target |
JavaPeerableExtensionsTests.JavaAs |
MissingMethodException — IJavaInterfaceInvoker ctor trimmed |
JavaPeerableExtensionsTests.JavaAs_Exceptions |
Wrong exception type (ClassNotFoundException vs ArgumentException) |
JavaPeerableExtensionsTests.JavaAs_InstanceThatDoesNotImplementInterfaceReturnsNull |
No JavaPeerProxy for IAndroidInterface |
❌ JavaCast proxy resolution (4 tests)
| Test | Error |
|---|---|
JavaObjectExtensionsTests.JavaCast_BadInterfaceCast |
NotSupportedException instead of InvalidCastException |
JavaObjectExtensionsTests.JavaCast_CheckForManagedSubclasses |
NotSupportedException instead of InvalidCastException |
JavaObjectExtensionsTests.JavaCast_InvalidTypeCastThrows |
NotSupportedException instead of InvalidCastException |
JavaObjectExtensionsTests.JavaCast_BaseToGenericWrapper |
Cannot create instance of open generic type |
❌ Open generic types / registration (4 tests)
| Test | Error |
|---|---|
JnienvTest.NewOpenGenericTypeThrows |
Open generic creation succeeds when it should throw NotSupportedException |
JnienvTest.ActivatedDirectThrowableSubclassesShouldBeRegistered |
Throwable subclass not registered (Expected: True, But was: False) |
ObjectTest.GetObject_ReturnsMostDerivedType |
Returns Java.Lang.Object instead of Java.Lang.String |
ObjectTest.JnienvCreateInstance_RegistersMultipleInstances |
Instance identity differs after JNI round-trip |
❌ JNI method remapping not supported (4 tests)
| Test | Error |
|---|---|
JniPeerMembersTests.ReplaceInstanceMethodName |
NoSuchMethodError — remapped method not found |
JniPeerMembersTests.ReplaceInstanceMethodWithStaticMethod |
NoSuchMethodError |
JniPeerMembersTests.ReplaceStaticMethodName |
NoSuchMethodError |
JniPeerMembersTests.ReplacementTypeUsedForMethodLookup |
Returns wrong hash code |
❌ Other (3 tests)
| Test | Error |
|---|---|
JniTypeManagerTests.GetType |
InvalidOperationException — no JniPrimitiveArrayInfo for JavaBooleanArray |
CustomWidgetTests.InflateCustomView_ShouldNotLeakGlobalRefs |
256 extra global refs after inflating/GC'ing 100 custom views |
✅ Previously excluded, now (re)enabled (45 tests)
As of PR #11091, all over-broad exclusions were replaced with precise per-test exclusions. 45 tests that were previously silently excluded now run and pass:
GetObjectArray(wasCoreCLRIgnore)- 3 NTLM negotiate auth tests (were
NTLMcategory) JavaExceptionTests.InnerException,StackTraceJavaObjectExtensionsTests.JavaAs- 11
JavaObjectTesttests (Ctor, Dispose, GC, registration, etc.) JavaPeerableExtensionsTests.JavaAs_NullSelfReturnsNull- 4
JniPeerMembersTeststests (Ctor, desugaring, fallback lookup, virtual invoke) - 3
JniTypeManagerTeststests (CanCreateGenericHolder, GetTypeSignature×2) - 16
JniValueMarshaler_IJavaPeerable_ContractTeststests - 3
JniValueMarshaler_object_ContractTeststests - 3
CustomWidgetTestsinflate tests
Summary Table
| Root Cause | Count |
|---|---|
Missing net.dot.jni.test.* Java classes |
5 |
JavaProxyObject/JavaProxyThrowable not available |
24 |
| Proxy resolution / trimmer gaps | 5 |
| JavaCast proxy resolution | 4 |
| Open generic types / registration | 4 |
| JNI method remapping | 4 |
| Other | 2 |
| Total excluded | 48 |
| Previously excluded, now (re)enabled | 45 |
Activity
[-][TrimmableTypeMap] Trimmable typemap test exclusions: failing Java.Interop-Tests inventory[/-][+][TrimmableTypeMap] Trimmable typemap test exclusions inventory[/+]Update CoreCLRTrimmable test exclusions with proper documentation
Update CoreCLRTrimmable test exclusions with proper documentation
Remove trimmable-specific test exclusions (TrimmableIgnore + name-based)
Restore targeted test exclusions for trimmable typemap
[tests] Add CoreCLRTrimmable test plumbing for Mono.Android.NET-Tests
[TrimmableTypeMap] Add CoreCLRTrimmable Mono.Android.NET-Tests lane (#…
[tests] Add CoreCLRTrimmable test plumbing for Mono.Android.NET-Tests
Build-task coverage: trimmable [Export]/[ExportField] artifacts + tri…
[TrimmableTypeMap] Add trimmable [Export] and [ExportField] callback …
simonrozsival commentedon May 25, 2026
All exclusions have been addressed