diff options
Diffstat (limited to 'tests/src/GC/API/GCHandleCollector/Usage.cs')
-rw-r--r-- | tests/src/GC/API/GCHandleCollector/Usage.cs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/tests/src/GC/API/GCHandleCollector/Usage.cs b/tests/src/GC/API/GCHandleCollector/Usage.cs index b78271b243..f346966a6b 100644 --- a/tests/src/GC/API/GCHandleCollector/Usage.cs +++ b/tests/src/GC/API/GCHandleCollector/Usage.cs @@ -146,9 +146,16 @@ public class Usage // ensure threshold is increasing if (!CheckPercentageIncrease(handleCount, prevHandleCount)) { - // see github#4093 for the rationale for fail-fast in this test. - Environment.FailFast(string.Empty); - return false; + Console.WriteLine("Percentage not increasing, performing Collect/WFPF/Collect cycle"); + GC.Collect(); + GC.WaitForPendingFinalizers(); + GC.Collect(); + + if (handleCount == HandleCollectorTest.Count) + { + Console.WriteLine("No handles finalized in Collect/WFPF/Collect cycle"); + return false; + } } prevHandleCount = handleCount; } |