From c17a0c04c8613cc68f33b584cd0a8aaf8ca573c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomek=20Sowi=C5=84ski?= Date: Thu, 8 Aug 2024 12:14:55 +0200 Subject: [PATCH 1/2] Increase timeout to prevent failure of CancelKeyPressTests.ExitDetectionNotBlockedByHandler on Debug RISC-V --- src/libraries/System.Console/tests/CancelKeyPress.Unix.cs | 5 ++++- src/libraries/System.Console/tests/CancelKeyPress.cs | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/libraries/System.Console/tests/CancelKeyPress.Unix.cs b/src/libraries/System.Console/tests/CancelKeyPress.Unix.cs index 3211c14fec08e4..b1166c613dbe77 100644 --- a/src/libraries/System.Console/tests/CancelKeyPress.Unix.cs +++ b/src/libraries/System.Console/tests/CancelKeyPress.Unix.cs @@ -79,7 +79,10 @@ public void ExitDetectionNotBlockedByHandler() // Release CancelKeyPress, and give it time to return and tear down the app mre.Set(); Thread.Sleep(WaitFailTestTimeoutSeconds * 1000); - }, new RemoteInvokeOptions() { ExpectedExitCode = 130 }).Dispose(); + }, new RemoteInvokeOptions() { + ExpectedExitCode = 130, + TimeOut = RemoteExecutor.FailWaitTimeoutMilliseconds * PlatformDetection.SlowRuntimeTimeoutModifier + }).Dispose(); } private void HandlerInvokedForSignal(int signalOuter, bool redirectStandardInput) diff --git a/src/libraries/System.Console/tests/CancelKeyPress.cs b/src/libraries/System.Console/tests/CancelKeyPress.cs index d6385966c5e5c4..42ab7447414e87 100644 --- a/src/libraries/System.Console/tests/CancelKeyPress.cs +++ b/src/libraries/System.Console/tests/CancelKeyPress.cs @@ -10,7 +10,7 @@ public partial class CancelKeyPressTests { - private const int WaitFailTestTimeoutSeconds = 30; + private readonly int WaitFailTestTimeoutSeconds = 30 * PlatformDetection.SlowRuntimeTimeoutModifier; [Fact] [SkipOnPlatform(TestPlatforms.Browser | TestPlatforms.iOS | TestPlatforms.MacCatalyst | TestPlatforms.tvOS, "Not supported on Browser, iOS, MacCatalyst, or tvOS.")] From 832b95f93df4bfd0ef482054e438448fb2474c56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomek=20Sowi=C5=84ski?= Date: Fri, 9 Aug 2024 11:45:38 +0200 Subject: [PATCH 2/2] Make WaitFailTestTimeoutSeconds static, move it closer to where it's used --- src/libraries/System.Console/tests/CancelKeyPress.Unix.cs | 2 ++ src/libraries/System.Console/tests/CancelKeyPress.cs | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libraries/System.Console/tests/CancelKeyPress.Unix.cs b/src/libraries/System.Console/tests/CancelKeyPress.Unix.cs index b1166c613dbe77..02760d28163fea 100644 --- a/src/libraries/System.Console/tests/CancelKeyPress.Unix.cs +++ b/src/libraries/System.Console/tests/CancelKeyPress.Unix.cs @@ -42,6 +42,8 @@ public void HandlerInvokedForSigQuit(bool redirectStandardInput) HandlerInvokedForSignal(SIGQUIT, redirectStandardInput); } + private static readonly int WaitFailTestTimeoutSeconds = 30 * PlatformDetection.SlowRuntimeTimeoutModifier; + [ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))] public void ExitDetectionNotBlockedByHandler() { diff --git a/src/libraries/System.Console/tests/CancelKeyPress.cs b/src/libraries/System.Console/tests/CancelKeyPress.cs index 42ab7447414e87..b2deeaff48625f 100644 --- a/src/libraries/System.Console/tests/CancelKeyPress.cs +++ b/src/libraries/System.Console/tests/CancelKeyPress.cs @@ -10,8 +10,6 @@ public partial class CancelKeyPressTests { - private readonly int WaitFailTestTimeoutSeconds = 30 * PlatformDetection.SlowRuntimeTimeoutModifier; - [Fact] [SkipOnPlatform(TestPlatforms.Browser | TestPlatforms.iOS | TestPlatforms.MacCatalyst | TestPlatforms.tvOS, "Not supported on Browser, iOS, MacCatalyst, or tvOS.")] public static void CanAddAndRemoveHandler()