Skip to content
Prev Previous commit
Next Next commit
Disable checking GCFreeSegment callbacks on 7.0
  • Loading branch information
Mike McLaughlin committed Jul 1, 2022
commit c3e37e00e6efe4bf2d06afcd29f3325f5b01434a
6 changes: 3 additions & 3 deletions src/tests/dotnet-stack/StackTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class StackTests
{
private readonly ITestOutputHelper _output;

private readonly string _correctStack70 = @" [Native Frames]
private const string _correctStack70 = @" [Native Frames]
System.Console.il!Interop+Kernel32.ReadFile(int,unsigned int8*,int32,int32&,int)
System.Console.il!System.ConsolePal+WindowsConsoleStream.ReadFileNative(int,value class System.Span`1<unsigned int8>,bool,int32&,bool)
System.Console.il!System.ConsolePal+WindowsConsoleStream.Read(value class System.Span`1<unsigned int8>)
Expand All @@ -31,7 +31,7 @@ public class StackTests
System.Console.il!System.Console.Read()
?!?";

private readonly string _correctStack60 = @" [Native Frames]
private const string _correctStack60 = @" [Native Frames]
System.Console.il!System.ConsolePal+WindowsConsoleStream.ReadFileNative(int,value class System.Span`1<unsigned int8>,bool,int32&,bool)
System.Console.il!System.ConsolePal+WindowsConsoleStream.Read(value class System.Span`1<unsigned int8>)
System.Console.il!System.IO.ConsoleStream.Read(unsigned int8[],int32,int32)
Expand All @@ -41,7 +41,7 @@ public class StackTests
System.Console.il!System.Console.Read()
StackTracee!Tracee.Program.Main(class System.String[])";

private readonly string _correctStack31 = @" [Native Frames]
private const string _correctStack31 = @" [Native Frames]
System.Console.il!System.ConsolePal+WindowsConsoleStream.ReadFileNative(int,unsigned int8[],int32,int32,bool,int32&,bool)
System.Console.il!System.ConsolePal+WindowsConsoleStream.Read(unsigned int8[],int32,int32)
System.Private.CoreLib.il!System.IO.StreamReader.ReadBuffer()
Expand Down
5 changes: 4 additions & 1 deletion src/tests/eventpipe/GCEvents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ await RemoteTestExecutorHelper.RunTestCaseAsync(() =>
List<string> testList = new List<string>();
for (int i = 0; i < 100_000_000; i ++)
{
// This test was failing (no GCFreeSegment callbacks) on x86 until this GC Collects happened.
if (RuntimeInformation.ProcessArchitecture == Architecture.X86)
{
if (i % 1_000_000 == 0)
Expand Down Expand Up @@ -225,7 +226,9 @@ await RemoteTestExecutorHelper.RunTestCaseAsync(() =>

Logger.logger.Log("GCCreateSegmentEvents: " + GCCreateSegmentEvents);
Logger.logger.Log("GCFreeSegmentEvents: " + GCFreeSegmentEvents);
bool GCSegmentResult = GCCreateSegmentEvents > 0 && GCFreeSegmentEvents > 0;

// Disable checking GCFreeSegmentEvents on .NET 7.0 issue: https://github.com/dotnet/diagnostics/issues/3143
bool GCSegmentResult = GCCreateSegmentEvents > 0 && (GCFreeSegmentEvents > 0 || Environment.Version.Major >= 7);
Logger.logger.Log("GCSegmentResult: " + GCSegmentResult);

Logger.logger.Log("GCAllocationTickEvents: " + GCAllocationTickEvents);
Expand Down