Skip to content

Commit 33419e8

Browse files
Update JavaObjectTest.cs
Context: dotnet/runtime#60638 (comment)
1 parent aa161bf commit 33419e8

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

tests/Java.Interop-Tests/Java.Interop/JavaObjectTest.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,20 +105,19 @@ public void Dispose ()
105105

106106
#if !NO_GC_BRIDGE_SUPPORT
107107
[Test]
108-
// See: https://github.com/dotnet/runtime/issues/60638
109-
[Category ("IgnoreInterpreter")]
110108
public void Dispose_Finalized ()
111109
{
112110
var d = false;
113111
var f = false;
114112
FinalizerHelpers.PerformNoPinAction (() => {
115-
var v = new JavaDisposedObject (() => d = true, () => f = true);
116-
GC.KeepAlive (v);
113+
FinalizerHelpers.PerformNoPinAction (() => {
114+
var v = new JavaDisposedObject (() => d = true, () => f = true);
115+
GC.KeepAlive (v);
116+
});
117+
JniEnvironment.Runtime.ValueManager.CollectPeers ();
117118
});
118119
JniEnvironment.Runtime.ValueManager.CollectPeers ();
119120
GC.WaitForPendingFinalizers ();
120-
JniEnvironment.Runtime.ValueManager.CollectPeers ();
121-
GC.WaitForPendingFinalizers ();
122121
Assert.IsFalse (d);
123122
Assert.IsTrue (f);
124123
}

0 commit comments

Comments
 (0)