AndroidValueManager contract exact peer-count assertions fail on device
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- android, csharp
- Domain
- mobile-dev, testing
Research direction
Start with tests/Mono.Android-Tests/Java.Interop-Tests/Java.InteropTests/AndroidValueManagerContractTests.cs and inspect how the fixture is selected for UseMonoRuntime and supported test lanes. Verify the TrimmableTypeMapUnsupported category on device, with the fixture excluded from supported CoreCLR and trimmable lanes while remaining available for the forced MonoVM configuration.
Written by the indexing model from the issue text.
Description
Android framework version
net11.0-android (Preview)
Affected platform version
.NET 11 Preview 7, forced unsupported MonoVM configuration
Description
Restoring the Android-specific AndroidValueManagerContractTests fixture on device exposes three incompatible inherited Java.Interop contract assertions:
AddPeer_NoDuplicatesConstructPeer_ImplicitViaBindingConstructor_PeerIsInSurfacedPeersConstructPeer_ImplicitViaBindingMethod_PeerIsInSurfacedPeers
These tests assert exact changes in GetSurfacedPeers().Count. On Android, constructing the bound test peers also surfaces related framework wrappers, so the count grows by more than one even when the tested peer has only one mapping. Marking the fixture nonparallel does not change the result.
AndroidValueManager is only selected by MonoVM. CoreCLR uses JavaMarshalValueManager, while the trimmable/NativeAOT paths use their own value managers. MonoVM mobile targets are unsupported in .NET 11, so this fixture should not compile into supported .NET 11 test lanes.
Steps to Reproduce
- Include
tests/Mono.Android-Tests/Java.Interop-Tests/Java.InteropTests/AndroidValueManagerContractTests.cs. - Force the unsupported MonoVM configuration with
UseMonoRuntime=trueand_DisableCheckForUnsupportedMonoMobileRuntime=true. - Build/install and run the
TrimmableTypeMapUnsupportedcategory on device.
Did you find any workaround?
Keep the Android-specific fixture conditional on UseMonoRuntime=true. Supported CoreCLR and trimmable lanes exclude it because they do not instantiate AndroidValueManager.
Relevant log output
AddPeer_NoDuplicates: expected 2 surfaced peers, observed 3
ConstructPeer_ImplicitViaBindingConstructor_PeerIsInSurfacedPeers: expected 1, observed 2
ConstructPeer_ImplicitViaBindingMethod_PeerIsInSurfacedPeers: expected 0, observed 1
- Dominant language
- C#
- Stars
- 2.1k
- Forks
- 580
- Avg merge
- 2d 19m
- Merged PRs (30d)
- 228
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dotnet/android
-
Area: Debugger enhancement needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
Area: Mono.Android
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
agentic-workflows needs-triage
-
automated needs-triage skill-runner
Difficulty 5/5 Over a week Newbie friendliness 10/100
-
Area: App Runtime needs-triage
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Similar issues
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
t/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
ci-failure-cause test-failure
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
area:auth FE mvp P3
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
klasolsson81/jobbliggaren#1788 ·