Skip to content

Commit 7a2763a

Browse files
authored
[RISC-V] System.Console CancelKeyPressTests.ExitDetectionNotBlockedByHandler increase timeout (#106119)
* Increase timeout to prevent failure of CancelKeyPressTests.ExitDetectionNotBlockedByHandler on Debug RISC-V * Make WaitFailTestTimeoutSeconds static, move it closer to where it's used
1 parent 3775354 commit 7a2763a

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

src/libraries/System.Console/tests/CancelKeyPress.Unix.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ public void HandlerInvokedForSigQuit(bool redirectStandardInput)
4242
HandlerInvokedForSignal(SIGQUIT, redirectStandardInput);
4343
}
4444

45+
private static readonly int WaitFailTestTimeoutSeconds = 30 * PlatformDetection.SlowRuntimeTimeoutModifier;
46+
4547
[ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))]
4648
public void ExitDetectionNotBlockedByHandler()
4749
{
@@ -79,7 +81,10 @@ public void ExitDetectionNotBlockedByHandler()
7981
// Release CancelKeyPress, and give it time to return and tear down the app
8082
mre.Set();
8183
Thread.Sleep(WaitFailTestTimeoutSeconds * 1000);
82-
}, new RemoteInvokeOptions() { ExpectedExitCode = 130 }).Dispose();
84+
}, new RemoteInvokeOptions() {
85+
ExpectedExitCode = 130,
86+
TimeOut = RemoteExecutor.FailWaitTimeoutMilliseconds * PlatformDetection.SlowRuntimeTimeoutModifier
87+
}).Dispose();
8388
}
8489

8590
private void HandlerInvokedForSignal(int signalOuter, bool redirectStandardInput)

src/libraries/System.Console/tests/CancelKeyPress.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010

1111
public partial class CancelKeyPressTests
1212
{
13-
private const int WaitFailTestTimeoutSeconds = 30;
14-
1513
[Fact]
1614
[SkipOnPlatform(TestPlatforms.Browser | TestPlatforms.iOS | TestPlatforms.MacCatalyst | TestPlatforms.tvOS, "Not supported on Browser, iOS, MacCatalyst, or tvOS.")]
1715
public static void CanAddAndRemoveHandler()

0 commit comments

Comments
 (0)