Skip to content

Commit 1ec231f

Browse files
authored
Try to reduce variance in FindRootsOlderGeneration SOS test (#5583)
1 parent 7960827 commit 1ec231f

File tree

1 file changed

+5
-0
lines changed
  • src/SOS/SOS.UnitTests/Debuggees/FindRootsOlderGeneration

1 file changed

+5
-0
lines changed

src/SOS/SOS.UnitTests/Debuggees/FindRootsOlderGeneration/Program.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ private static void Main()
2424
Debugger.Break();
2525

2626
Console.WriteLine("Forcing GC...");
27+
28+
// On CI runs, in server GC mode, these collects have sometimes triggered
29+
// a gen 2 collection that is not expected and causes the test to fail.
30+
// Adding "SustainedLowLatency" mode to try to prevent that.
31+
GCSettings.LatencyMode = GCLatencyMode.SustainedLowLatency;
2732
GC.Collect(0, GCCollectionMode.Forced, true);
2833
GC.Collect(0, GCCollectionMode.Forced, true);
2934
Console.WriteLine("GC complete.");

0 commit comments

Comments
 (0)