diff --git a/src/libraries/System.Console/tests/CancelKeyPress.Unix.cs b/src/libraries/System.Console/tests/CancelKeyPress.Unix.cs index 3211c14fec08e4..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() { @@ -79,7 +81,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..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 const int WaitFailTestTimeoutSeconds = 30; - [Fact] [SkipOnPlatform(TestPlatforms.Browser | TestPlatforms.iOS | TestPlatforms.MacCatalyst | TestPlatforms.tvOS, "Not supported on Browser, iOS, MacCatalyst, or tvOS.")] public static void CanAddAndRemoveHandler()