summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKoichi Sasada <[email protected]>2025-03-04 19:09:38 +0900
committerKoichi Sasada <[email protected]>2025-03-04 19:39:16 +0900
commitce66eea167847d4300150791bde4932b907b0cc0 (patch)
treede5b404fab076daa61f192abef23b25820286767
parentd7a96a285c5be8a4009f3e0a3fab2246fad060f3 (diff)
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.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/12849
-rw-r--r--test/test_timeout.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/test_timeout.rb b/test/test_timeout.rb
index 01156867b0..a8bc97dee4 100644
--- a/test/test_timeout.rb
+++ b/test/test_timeout.rb
@@ -274,4 +274,20 @@ class TestTimeout < Test::Unit::TestCase
}.join
end;
end
+
+ # TODO: remove it
+ require 'envutil'
+
+ def test_timeout_scale
+ scale = ENV['RUBY_TEST_TIMEOUT_SCALE']&.to_f
+ sec = 5
+
+ if scale
+ assert_equal sec * scale, EnvUtil.apply_timeout_scale(sec)
+ else
+ assert_equal sec, EnvUtil.apply_timeout_scale(sec)
+ end
+
+ STDERR.puts [scale, sec, EnvUtil.apply_timeout_scale(sec)].inspect
+ end
end