core_assertions.rb: Raise Timeout::Error explicitly

So that `assert_raise` inside the block works.
This commit is contained in:
Nobuyoshi Nakada 2023-03-23 01:13:23 +09:00
parent 0112a5b342
commit db7c38634e
No known key found for this signature in database
GPG Key ID: 7CD2805BFA3770C6

View File

@ -763,7 +763,7 @@ eom
t = tmax * i.fdiv(first)
*arg = pre.call(i)
message = "[#{i}]: in #{t}s"
Timeout.timeout(t, nil, message) do
Timeout.timeout(t, Timeout::Error, message) do
st = Process.clock_gettime(Process::CLOCK_MONOTONIC)
yield(*arg)
assert_operator (Process.clock_gettime(Process::CLOCK_MONOTONIC) - st), :<=, t, message