summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2021-09-11 11:21:37 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2021-09-11 11:21:37 +0900
commitb1789294695432557fbb79d5ba522c2eaa5b968d (patch)
tree14a1210abedf90b00fa39690fd6c29a7f52dad67
parent2bc85766c0886fd690576f19fb3cc454dbb818bf (diff)
Fixed uninitialized constant Test::Unit::Assertions::MIN_MEASURABLE.
I'm not sure why it's failed under the chkbuild and rubyci. http://rubyci.s3.amazonaws.com/arch/ruby-master/log/20210911T000007Z.fail.html.gz
-rw-r--r--tool/lib/test/unit/assertions.rb5
-rw-r--r--tool/lib/test/unit/testcase.rb5
2 files changed, 5 insertions, 5 deletions
diff --git a/tool/lib/test/unit/assertions.rb b/tool/lib/test/unit/assertions.rb
index 335247458a..1368312925 100644
--- a/tool/lib/test/unit/assertions.rb
+++ b/tool/lib/test/unit/assertions.rb
@@ -842,6 +842,11 @@ EOT
result
end
+ # kernel resolution can limit the minimum time we can measure
+ # [ruby-core:81540]
+ MIN_HZ = /mswin|mingw/ =~ RUBY_PLATFORM ? 67 : 100
+ MIN_MEASURABLE = 1.0 / MIN_HZ
+
def assert_cpu_usage_low(msg = nil, pct: 0.05, wait: 1.0, stop: nil)
require 'benchmark'
diff --git a/tool/lib/test/unit/testcase.rb b/tool/lib/test/unit/testcase.rb
index 19d90c58eb..6753d22bde 100644
--- a/tool/lib/test/unit/testcase.rb
+++ b/tool/lib/test/unit/testcase.rb
@@ -156,11 +156,6 @@ module Test
PASSTHROUGH_EXCEPTIONS = [NoMemoryError, SignalException,
Interrupt, SystemExit] # :nodoc:
- # kernel resolution can limit the minimum time we can measure
- # [ruby-core:81540]
- MIN_HZ = windows? ? 67 : 100
- MIN_MEASURABLE = 1.0 / MIN_HZ
-
##
# Runs the tests reporting the status to +runner+