Skip to content

Commit

Permalink
Limit the number of JIT/HardwareIntrinsics/* tests when running under…
Browse files Browse the repository at this point in the history
… GCStress (#65049)
  • Loading branch information
echesakov authored Feb 9, 2022
1 parent ee4640a commit 30abc7b
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/tests/Common/CoreCLRTestLibrary/Utilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ public static bool IsWindowsIoTCore
public static bool IsReflectionEmitSupported => true;
#endif
public static bool SupportsExceptionInterop => IsWindows && IsNotMonoRuntime && !IsNativeAot; // matches definitions in clr.featuredefines.props
public static bool IsGCStress => (Environment.GetEnvironmentVariable("COMPlus_GCStress") != null) || (Environment.GetEnvironmentVariable("DOTNET_GCStress") != null);

public static string ByteArrayToString(byte[] bytes)
{
Expand Down
13 changes: 12 additions & 1 deletion src/tests/JIT/HardwareIntrinsics/Arm/Shared/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public static partial class Program
{
private const int PASS = 100;
private const int FAIL = 0;
private const int MaximumTestCountGCStress = 30;

private static readonly IDictionary<string, Action> TestList;

Expand Down Expand Up @@ -63,7 +64,17 @@ private static ICollection<string> GetTestsToRun(string[] args)
testsToRun.Add(testName);
}

return (testsToRun.Count == 0) ? TestList.Keys : testsToRun;
if (testsToRun.Count != 0)
{
return testsToRun;
}

if (TestLibrary.Utilities.IsGCStress)
{
return TestList.Keys.Take(MaximumTestCountGCStress).ToArray();
}

return TestList.Keys;
}

private static void PrintSupportedIsa()
Expand Down
13 changes: 12 additions & 1 deletion src/tests/JIT/HardwareIntrinsics/General/Shared/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public static partial class Program
{
private const int PASS = 100;
private const int FAIL = 0;
private const int MaximumTestCountGCStress = 30;

private static readonly IDictionary<string, Action> TestList;

Expand Down Expand Up @@ -61,7 +62,17 @@ private static ICollection<string> GetTestsToRun(string[] args)
testsToRun.Add(testName);
}

return (testsToRun.Count == 0) ? TestList.Keys : testsToRun;
if (testsToRun.Count != 0)
{
return testsToRun;
}

if (TestLibrary.Utilities.IsGCStress)
{
return TestList.Keys.Take(MaximumTestCountGCStress).ToArray();
}

return TestList.Keys;
}

private static void PrintUsage()
Expand Down
13 changes: 12 additions & 1 deletion src/tests/JIT/HardwareIntrinsics/X86/Shared/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public static partial class Program
{
private const int PASS = 100;
private const int FAIL = 0;
private const int MaximumTestCountGCStress = 30;

private static readonly IDictionary<string, Action> TestList;

Expand Down Expand Up @@ -63,7 +64,17 @@ private static ICollection<string> GetTestsToRun(string[] args)
testsToRun.Add(testName);
}

return (testsToRun.Count == 0) ? TestList.Keys : testsToRun;
if (testsToRun.Count != 0)
{
return testsToRun;
}

if (TestLibrary.Utilities.IsGCStress)
{
return TestList.Keys.Take(MaximumTestCountGCStress).ToArray();
}

return TestList.Keys;
}

private static void PrintSupportedIsa()
Expand Down

0 comments on commit 30abc7b

Please sign in to comment.