From 61a3956a507c94a396ee52d9b0195bf41984cdda Mon Sep 17 00:00:00 2001 From: Sergey Andreenko Date: Fri, 16 Feb 2018 09:21:03 -0800 Subject: [PATCH] Fix dlStack test (#16410) --- tests/arm/Tests.lst | 2 +- tests/src/GC/Scenarios/DoublinkList/dlstack.cs | 21 +++++++++++++++------ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/tests/arm/Tests.lst b/tests/arm/Tests.lst index eb7fab5..407ab2c 100644 --- a/tests/arm/Tests.lst +++ b/tests/arm/Tests.lst @@ -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] diff --git a/tests/src/GC/Scenarios/DoublinkList/dlstack.cs b/tests/src/GC/Scenarios/DoublinkList/dlstack.cs index 8fa63bf..585c6a2 100644 --- a/tests/src/GC/Scenarios/DoublinkList/dlstack.cs +++ b/tests/src/GC/Scenarios/DoublinkList/dlstack.cs @@ -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; -- 2.7.4