From 4172d08261e649d721c03ee7f368b568abc892a6 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 24 Sep 2018 23:23:14 +0000 Subject: [PATCH] test/unit.rb: fix --subprocess-timeout-scale * test/lib/test/unit.rb (Test::Unit::SubprocessOption#non_options): set timeout scale after parsing options. the option value will be set after returning from setup_options. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64827 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/lib/test/unit.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/lib/test/unit.rb b/test/lib/test/unit.rb index da05d57344..f588aec551 100644 --- a/test/lib/test/unit.rb +++ b/test/lib/test/unit.rb @@ -1048,10 +1048,14 @@ module Test raise OptionParser::InvalidArgument, "timeout scale must be positive" unless scale > 0 options[:timeout_scale] = scale end + end + + def non_options(files, options) if scale = options[:timeout_scale] or (scale = ENV["RUBY_TEST_SUBPROCESS_TIMEOUT_SCALE"] and (scale = scale.to_f) > 0) EnvUtil.subprocess_timeout_scale = scale end + super end end