Skip to content
This repository was archived by the owner on Aug 27, 2026. It is now read-only.

[tests] Add NativeAOTIgnore to InvokeVirtualFromConstructorTests - #1390

Merged
jonathanpeppers merged 1 commit into
mainfrom
dev/copilot/nativeaot-ignore-invoke-virtual
Mar 16, 2026
Merged

[tests] Add NativeAOTIgnore to InvokeVirtualFromConstructorTests#1390
jonathanpeppers merged 1 commit into
mainfrom
dev/copilot/nativeaot-ignore-invoke-virtual

Conversation

@jonathanpeppers

Copy link
Copy Markdown
Member

These 3 tests fail on NativeAOT with DelegateMarshalling_MissingInteropData because PreserveRegistrations does not handle [JniAddNativeMethodRegistrationAttribute] delegate types. NativeAOT cannot generate the unmanaged-callable wrapper for CalledFromConstructorMarshalMethod at runtime.

Tracking issue: dotnet/android#10950
Context: dotnet/android#10496

Tests marked:

  • InvokeVirtualFromConstructorTests.CreateJavaInstanceFirst
  • InvokeVirtualFromConstructorTests.CreateManagedInstanceFirst_WithAllocObject
  • InvokeVirtualFromConstructorTests.CreateManagedInstanceFirst_WithNewObject

These 3 tests fail on NativeAOT with DelegateMarshalling_MissingInteropData
because PreserveRegistrations does not handle [JniAddNativeMethodRegistrationAttribute]
delegate types. NativeAOT cannot generate the unmanaged-callable wrapper for
CalledFromConstructorMarshalMethod at runtime.
Tracking issue: dotnet/android#10950
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
CopilotAI review requested due to automatic review settings March 16, 2026 14:28

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates Java.Interop unit tests to allow excluding known-problematic constructor/virtual-invocation scenarios from NativeAOT test runs (linked to dotnet/android#10950).

Changes:

  • Mark three InvokeVirtualFromConstructorTests test cases with Category ("NativeAOTIgnore") to enable filtering in NativeAOT environments.

@jonathanpeppers
jonathanpeppers merged commit fb0952f into mainMar 16, 2026
6 checks passed
@jonathanpeppers
jonathanpeppers deleted the dev/copilot/nativeaot-ignore-invoke-virtual branch March 16, 2026 15:28
@github-actionsgithub-actionsBot locked and limited conversation to collaborators Apr 16, 2026
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@jonathanpeppers