From 2114d0af1e5790da365584a38ea7ee58670dc11b Mon Sep 17 00:00:00 2001 From: Yusuke Endoh Date: Tue, 28 May 2024 12:04:34 +0900 Subject: [PATCH] Make test_nested_timeouts less flaky This test randomly fails due to the bug reported in [Bug #20314], where the two timeouts are too close so that they can expire at the same time. As a workaround, this change increases the time difference between timeouts. This will reduce the probability of simultaneous expirations and lower flakiness. --- test/test_timeout.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test_timeout.rb b/test/test_timeout.rb index e900b10cd7..34966f92a4 100644 --- a/test/test_timeout.rb +++ b/test/test_timeout.rb @@ -66,7 +66,7 @@ class TestTimeout < Test::Unit::TestCase a = nil assert_raise(Timeout::Error) do Timeout.timeout(0.1) { - Timeout.timeout(1) { + Timeout.timeout(30) { nil while true } a = 1 @@ -84,7 +84,7 @@ class TestTimeout < Test::Unit::TestCase def test_nested_timeout_error_identity begin Timeout.timeout(0.1, MyNewErrorOuter) { - Timeout.timeout(1, MyNewErrorInner) { + Timeout.timeout(30, MyNewErrorInner) { nil while true } }