Skip to content

Commit

Permalink
Fix regression in CoreClrConfigurationDetection (#8222)
Browse files Browse the repository at this point in the history
In 16988fc the refactoring added `IsGCStress` and used it in the `IsStressTest` property.
However the `GetEnvironmentVariableValue("GCStress") != string.Empty` is always true since `GetEnvironmentVariableValue` will return the string "0" if the env variable isn't set.

This in turn caused `StressModeApplies` to return false for `RuntimeTestModes.RegularRun` which made the `SkipOnCoreClr` attribute a no-op in regular runs.
  • Loading branch information
akoeplinger authored Nov 26, 2021
1 parent 6b74f9e commit 427c059
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public static class CoreClrConfigurationDetection
public static bool IsGCStress3 => CompareGCStressModeAsLower(GetEnvironmentVariableValue("GCStress"), "0x3", "3");
public static bool IsGCStressC => CompareGCStressModeAsLower(GetEnvironmentVariableValue("GCStress"), "0xC", "C");

public static bool IsGCStress => GetEnvironmentVariableValue("GCStress") != string.Empty;
public static bool IsGCStress => !string.Equals(GetEnvironmentVariableValue("GCStress"), "0", StringComparison.InvariantCulture);

public static bool IsCheckedRuntime => AssemblyConfigurationEquals("Checked");
public static bool IsReleaseRuntime => AssemblyConfigurationEquals("Release");
Expand Down

0 comments on commit 427c059

Please sign in to comment.