Skip to content

Commit ce66eea

Browse files
committed
try to show timeout sec
http://ci.rvm.jp/results/trunk-gc-asserts@ruby-sp2-noble-docker/5632508 ``` 1) Error: TestEval#test_outer_local_variable_under_gc_compact_stress: Test::Unit::ProxyError: execution of Test::Unit::CoreAssertions#assert_separately expired timeout (10 sec) pid 1339179 killed by SIGABRT (signal 6) (core dumped) ``` seems that timeout scale doesn't work even though `RUBY_TEST_TIMEOUT_SCALE` is specified. This patch tries to print the timeout with scale information.
1 parent d7a96a2 commit ce66eea

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/test_timeout.rb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,4 +274,20 @@ def test_handling_enclosed_threadgroup
274274
}.join
275275
end;
276276
end
277+
278+
# TODO: remove it
279+
require 'envutil'
280+
281+
def test_timeout_scale
282+
scale = ENV['RUBY_TEST_TIMEOUT_SCALE']&.to_f
283+
sec = 5
284+
285+
if scale
286+
assert_equal sec * scale, EnvUtil.apply_timeout_scale(sec)
287+
else
288+
assert_equal sec, EnvUtil.apply_timeout_scale(sec)
289+
end
290+
291+
STDERR.puts [scale, sec, EnvUtil.apply_timeout_scale(sec)].inspect
292+
end
277293
end

0 commit comments

Comments
 (0)