[ruby/mmtk] Use RUBY_TEST_TIMEOUT_SCALE for tests

RUBY_TEST_TIMEOUT_SCALE is set for debug builds because they are slower
to run. We should respect this environment variable in MMTk tests too.

https://github.com/ruby/mmtk/commit/0a66c518bf
This commit is contained in:
Peter Zhu 2025-02-10 14:06:47 -05:00 committed by git
parent b4bf3ed130
commit 50469809b8
2 changed files with 11 additions and 0 deletions

View File

@ -9,9 +9,18 @@ module MMTk
def setup
omit "Not running on MMTk" unless using_mmtk?
@original_timeout_scale = EnvUtil.timeout_scale
timeout_scale = ENV["RUBY_TEST_TIMEOUT_SCALE"].to_f
EnvUtil.timeout_scale = timeout_scale if timeout_scale > 0
super
end
def teardown
EnvUtil.timeout_scale = @original_timeout_scale
end
private
def using_mmtk?

View File

@ -1,5 +1,7 @@
# frozen_string_literal: true
require_relative "helper"
module MMTk
class TestConfiguration < TestCase
def test_MMTK_THREADS