You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CoreCLR test failure: Java.InteropTests.JavaObjectTest.Dispose_Finalized #10358
failed Dispose_Finalized
Expected JavaDisposedObject.Dispose(disposing: false) to run.
Expected: True
But was: False
at Java.InteropTests.JavaObjectTest.WaitForGC(Func`1 predicate, String message, Int32 timeoutMilliseconds)
at Java.InteropTests.JavaObjectTest.Dispose_Finalized()
at NUnit.Framework.Internal.TaskAwaitAdapter.GenericAdapter`1.BlockUntilCompleted()
at NUnit.Framework.Internal.MessagePumpStrategy.NoMessagePumpStrategy.WaitForCompletion(AwaitAdapter awaiter)
at NUnit.Framework.Internal.AsyncToSyncAdapter.Await(Func`1 invoke)
at NUnit.Framework.Internal.Commands.TestMethodCommand.RunTestMethod(TestExecutionContext context)
at NUnit.Framework.Internal.Commands.TestMethodCommand.Execute(TestExecutionContext context)
at NUnit.Framework.Internal.Execution.SimpleWorkItem.<>c__DisplayClass4_0.<PerformWork>b__0()
at NUnit.Framework.Internal.ContextUtils.<>c__DisplayClass1_0`1.<DoIsolated>b__0(Object _)
from /Users/runner/work/1/s/bin/TestDebug/net11.0-android/Mono.Android.NET-Tests.dll (net11.0|x64)
Notes since this was last closed
The test was reworked to be deterministic in dotnet/java-interop#1408 (merged 2026-04-21), following the earlier dotnet/java-interop#1338. The current implementation waits on the finalizer/collection condition directly, bounded to a 2000 ms timeout in WaitForGC:
This failure means the finalizer path (Dispose(disposing: false)) did not run within that 2 s window — i.e. the determinism rework reduced but did not eliminate the timing dependence, plausibly on a slow/loaded CI device. Worth considering a longer/adaptive timeout or a more robust wait for the GC-bridge + finalizer to complete.
Activity
jonathanpeppers commentedon Jul 30, 2025
/cc @simonrozsival if you want to take a look
simonrozsival commentedon Jul 31, 2025
@jonathanpeppers I was not able to reproduce the test failure. The test is passing for me in both Debug and Release configuration with CoreCLR 🤔
jonathanpeppers commentedon Jul 31, 2025
It could be a rare/race condition type thing.
I was looking and for some reason our CI is still API 29:
android/build-tools/scripts/TestApks.targets
Line 22 in 855887f
So, I can try updating this in the meantime.
jonathanpeppers commentedon Aug 18, 2025
This hasn't happened again yet. Will reopen if it does.
simonrozsival commentedon Jul 13, 2026
Recurrence (net11.0, Debug)
This failed again, so reopening per the note above ("Will reopen if it does").
Java.InteropTests.JavaObjectTest.Dispose_Finalizednet11.0-android(net11.0 | x64), Debug —bin/TestDebug/net11.0-android/Mono.Android.NET-Tests.dllNotes since this was last closed
The test was reworked to be deterministic in dotnet/java-interop#1408 (merged 2026-04-21), following the earlier dotnet/java-interop#1338. The current implementation waits on the finalizer/collection condition directly, bounded to a 2000 ms timeout in
WaitForGC:Source:
external/Java.Interop/tests/Java.Interop-Tests/Java.Interop/JavaObjectTest.cs(dotnet/java-interop).This failure means the finalizer path (
Dispose(disposing: false)) did not run within that 2 s window — i.e. the determinism rework reduced but did not eliminate the timing dependence, plausibly on a slow/loaded CI device. Worth considering a longer/adaptive timeout or a more robust wait for the GC-bridge + finalizer to complete.Related