diff --git a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs index ac7d5e5a3ee6d8..646bd7260f6002 100644 --- a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs +++ b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs @@ -108,17 +108,16 @@ public static bool IsPrivilegedProcess // For use as needed on tests that time out when run on a Debug or Checked runtime. // Not relevant for timeouts on external activities, such as network timeouts. - public static int SlowRuntimeTimeoutModifier + public static int SlowRuntimeTimeoutModifier = GetSlowRuntimeTimeoutModifier(); + + private static int GetSlowRuntimeTimeoutModifier() { - get - { - if (IsReleaseRuntime) - return 1; - if (IsRiscV64Process) - return IsDebugRuntime? 10 : 2; - else - return IsDebugRuntime? 5 : 1; - } + if (IsReleaseRuntime) + return 1; + if (IsRiscV64Process) + return IsDebugRuntime? 10 : 2; + else + return IsDebugRuntime? 5 : 1; } public static bool IsCaseInsensitiveOS => IsWindows || IsOSX || IsMacCatalyst;