From 967ac57db6cc225f0543677ece087a405acb3afa Mon Sep 17 00:00:00 2001 From: EgorBo Date: Sat, 23 Dec 2023 17:35:35 +0100 Subject: [PATCH 1/2] Revert "[RISC-V] Fix ProcessWaitingTests.WaitChain and ProcessWaitingTests.WaitAsyncChain (#96187)" This reverts commit 476a455426e9ec6239d4a408bfc38bbc00db5187. --- .../TestUtilities/System/PlatformDetection.cs | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs index ac7d5e5a3ee6d8..238aee9ccfd023 100644 --- a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs +++ b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs @@ -106,20 +106,9 @@ public static bool IsPrivilegedProcess public static bool IsReleaseLibrary(Assembly assembly) => !IsDebuggable(assembly); public static bool IsDebugLibrary(Assembly assembly) => IsDebuggable(assembly); - // For use as needed on tests that time out when run on a Debug or Checked runtime. + // For use as needed on tests that time out when run on a Debug runtime. // Not relevant for timeouts on external activities, such as network timeouts. - public static int SlowRuntimeTimeoutModifier - { - get - { - if (IsReleaseRuntime) - return 1; - if (IsRiscV64Process) - return IsDebugRuntime? 10 : 2; - else - return IsDebugRuntime? 5 : 1; - } - } + public static int SlowRuntimeTimeoutModifier = (PlatformDetection.IsDebugRuntime ? 5 : 1); public static bool IsCaseInsensitiveOS => IsWindows || IsOSX || IsMacCatalyst; public static bool IsCaseSensitiveOS => !IsCaseInsensitiveOS; From ae11bbb73424057f46df9e39ad84ea38aea96ec3 Mon Sep 17 00:00:00 2001 From: EgorBo Date: Sat, 23 Dec 2023 21:00:56 +0100 Subject: [PATCH 2/2] Test --- .../TestUtilities/System/PlatformDetection.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs index 238aee9ccfd023..646bd7260f6002 100644 --- a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs +++ b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs @@ -106,9 +106,19 @@ public static bool IsPrivilegedProcess public static bool IsReleaseLibrary(Assembly assembly) => !IsDebuggable(assembly); public static bool IsDebugLibrary(Assembly assembly) => IsDebuggable(assembly); - // For use as needed on tests that time out when run on a Debug runtime. + // 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 = (PlatformDetection.IsDebugRuntime ? 5 : 1); + public static int SlowRuntimeTimeoutModifier = GetSlowRuntimeTimeoutModifier(); + + private static int GetSlowRuntimeTimeoutModifier() + { + if (IsReleaseRuntime) + return 1; + if (IsRiscV64Process) + return IsDebugRuntime? 10 : 2; + else + return IsDebugRuntime? 5 : 1; + } public static bool IsCaseInsensitiveOS => IsWindows || IsOSX || IsMacCatalyst; public static bool IsCaseSensitiveOS => !IsCaseInsensitiveOS;