Skip to content

[tests] Add NativeAOTIgnore to InvokeVirtualFromConstructorTests#1390

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

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

Conversation

@jonathanpeppers
Copy link
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>
Copilot AI review requested due to automatic review settings March 16, 2026 14:28
Copy link

Copilot AI left a comment

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 main Mar 16, 2026
6 checks passed
@jonathanpeppers jonathanpeppers deleted the dev/copilot/nativeaot-ignore-invoke-virtual branch March 16, 2026 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants