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.
This commit is contained in:
Yusuke Endoh 2024-05-28 12:04:34 +09:00
parent 7c6e4bc7ca
commit 2114d0af1e

View File

@ -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
}
}