diff options
author | Sean Gillespie <sean@swgillespie.me> | 2017-04-26 14:50:19 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-26 14:50:19 -0700 |
commit | ae975d418cb909b44ea9ba7fe4728442935e27c5 (patch) | |
tree | 5ef23a573b5b8baaf96207d522a41c5650a53ec2 /tests/src/GC/API/GCHandleCollector | |
parent | dc16711b74221e4905fdd766936954ef0c1a82af (diff) | |
download | coreclr-ae975d418cb909b44ea9ba7fe4728442935e27c5.tar.gz coreclr-ae975d418cb909b44ea9ba7fe4728442935e27c5.tar.bz2 coreclr-ae975d418cb909b44ea9ba7fe4728442935e27c5.zip |
Fix and re-enable some GC finalizer tests (#11216)
* Fix and re-enable some GC finalizer tests
* Make the Usage test a little more robust
Diffstat (limited to 'tests/src/GC/API/GCHandleCollector')
-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; } |