Skip to content

[tests] use FinalizerHelper from mono/mono #893

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

jonathanpeppers
Copy link
Member

Context: dotnet/android#6363

We're seeing a test failure in the latest .NET 6 bump:

Expected: True
But was:  False
at Java.InteropTests.JavaObjectTest.Dispose_Finalized()
at System.Reflection.RuntimeMethodInfo.Invoke(Object , BindingFlags , Binder , Object[] , CultureInfo )

The recommendation was to use a helper method from mono/mono's unit
tests:

https://github.com/mono/mono/blob/8266c5604b8c03882f2b06af27fdea46b142d6b9/mono/mini/TestHelpers.cs#L12

I removed usage of all System.Threading in JavaObjectTest in favor
of this helper method.

Context: dotnet/android#6363

We're seeing a test failure in the latest .NET 6 bump:

    Expected: True
    But was:  False
    at Java.InteropTests.JavaObjectTest.Dispose_Finalized()
    at System.Reflection.RuntimeMethodInfo.Invoke(Object , BindingFlags , Binder , Object[] , CultureInfo )

The recommendation was to use a helper method from mono/mono's unit
tests:

https://github.com/mono/mono/blob/8266c5604b8c03882f2b06af27fdea46b142d6b9/mono/mini/TestHelpers.cs#L12

I removed usage of all `System.Threading` in `JavaObjectTest` in favor
of this helper method.
jonathanpeppers added a commit to dotnet/android that referenced this pull request Oct 15, 2021
jonathanpeppers added a commit to dotnet/android that referenced this pull request Oct 15, 2021
jonathanpeppers added a commit to dotnet/android that referenced this pull request Oct 19, 2021
@jonathanpeppers
Copy link
Member Author

I don't think we need this.

jonpryor pushed a commit that referenced this pull request Oct 20, 2021
)

Context: dotnet/android#6363
Context: dotnet/android#6363 (comment)
Context: #893
Context: dotnet/runtime#60638
Context: dotnet/runtime@491ed9a...e013f14

An "odd" problem arose in dotnet/android#6363, which
attempted to bump to dotnet/runtime@e013f14c:
the [`JavaObjectTest.Dispose_Finalized()` test][0] started failing.
Doubly odd is that this test has been working fine for *years*, and
there are no "obviously relevant" changes in the dotnet/runtime diff.

There was a suggestion to use try using
[`FinalizeHelpers.PerformNoPinAction()`][1], but this didn't fix the
failing unit test.

In order to "unblock" the dotnet/runtime bump in
xamarin/xamarin-android, add a `[Category ("IgnoreInterpreter")]` to
the `Dispose_Finalized()` test, so that it can be ignored for now.

We have also filed dotnet/runtime#60638 to track a proper fix.

[0]: https://github.com/xamarin/java.interop/blob/4277ac96eb4f2dd191e86f7bc1b72f7bdd4fbb0c/tests/Java.Interop-Tests/Java.Interop/JavaObjectTest.cs#L112-L129
[1]: https://github.com/mono/mono/blob/8266c5604b8c03882f2b06af27fdea46b142d6b9/mono/mini/TestHelpers.cs#L12-L44
@github-actions github-actions bot locked and limited conversation to collaborators Apr 13, 2024
Sign up for free to 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.

1 participant