Fix some tests under GCStress (#16048)
authorKoundinya Veluri <kouvel@users.noreply.github.com>
Sat, 27 Jan 2018 03:39:51 +0000 (19:39 -0800)
committerGitHub <noreply@github.com>
Sat, 27 Jan 2018 03:39:51 +0000 (19:39 -0800)
- Disabled one test, it takes far too long under GCStress
- For another, added a second call to WaitForPendingFinalizers() to ensure correspondence with a GC.Collect() call

tests/src/CoreMangLib/system/span/SlowTailCallArgs.csproj
tests/src/baseservices/compilerservices/dynamicobjectproperties/dev10_535767.cs

index 69e86c9..6afa0ee 100644 (file)
@@ -12,6 +12,7 @@
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
     <CLRTestKind>BuildAndRun</CLRTestKind>
     <CLRTestPriority>1</CLRTestPriority>
+    <GCStressIncompatible>true</GCStressIncompatible>
   </PropertyGroup>
   <!-- Default configurations to help VS understand the configurations -->
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -26,4 +27,4 @@
     <Compile Include="SlowTailCallArgs.cs" />
   </ItemGroup>
   <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
\ No newline at end of file
+</Project>
index 19c15b5..cb7f360 100644 (file)
@@ -238,6 +238,7 @@ class TestSet
         // which nodes were collected).
         GC.Collect();
         GC.WaitForPendingFinalizers();
+        GC.WaitForPendingFinalizers(); // the above call may correspond to a GC prior to the Collect above, call it again
 
         // Calculate our own view of which nodes should be alive or dead. Use a simple mark array for this.
         // Once the algorithm is complete a true value at a given index in the array indicates a node that