Fix dlStack test (#16410)
authorSergey Andreenko <seandree@microsoft.com>
Fri, 16 Feb 2018 17:21:03 +0000 (09:21 -0800)
committerGitHub <noreply@github.com>
Fri, 16 Feb 2018 17:21:03 +0000 (09:21 -0800)
tests/arm/Tests.lst
tests/src/GC/Scenarios/DoublinkList/dlstack.cs

index eb7fab5..407ab2c 100644 (file)
@@ -881,7 +881,7 @@ RelativePath=GC\Scenarios\DoublinkList\dlstack\dlstack.cmd
 WorkingDir=GC\Scenarios\DoublinkList\dlstack
 Expected=0
 MaxAllowedDurationSeconds=600
-Categories=EXPECTED_PASS;JITSTRESS_FAIL;15156
+Categories=EXPECTED_PASS
 HostStyle=0
 
 [Generated1222.cmd_112]
index 8fa63bf..585c6a2 100644 (file)
@@ -94,13 +94,9 @@ namespace DoubLink {
 
         public bool runTest(int iRep, int iObj)
         {
-            bool success = false;
-            for(int i=0; i <10; i++)
-            {
-                SetLink(iRep, iObj);
-                MakeLeak(iRep);
-            }
+            CreateDLinkListsWithLeak(iRep, iObj);
 
+            bool success = false;
             if (DrainFinalizerQueue(iRep, iObj))
             {
                 success = true;
@@ -112,6 +108,19 @@ namespace DoubLink {
         }
 
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
+        // Do not inline the method that creates GC objects, because it could 
+        // extend their live intervals until the end of the parent method.
+        public void CreateDLinkListsWithLeak(int iRep, int iObj)
+        {
+            for(int i=0; i <10; i++)
+            {
+                SetLink(iRep, iObj);
+                MakeLeak(iRep);
+            }
+        }
+
+
         public void SetLink(int iRep, int iObj)
         {
             DLinkNode[] Mv_DLink;