diff options
author | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-05-28 01:43:38 +0000 |
---|---|---|
committer | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-05-28 01:43:38 +0000 |
commit | 109ccfdb2c85c81d16ad7c64bfe233883d841d5a (patch) | |
tree | 401dceef2e209039dac24f5656148e47fa9bc134 /test | |
parent | ddf2a1675ded37f85c448afb5923e61f98b5f262 (diff) | |
download | ruby-109ccfdb2c85c81d16ad7c64bfe233883d841d5a.tar.gz |
tests: increase CPU percentage threshold for assert_cpu_usage_low
When sleeping for the tick rate of 100ms (defined in
thread_pthread.c) as we do in test/ruby/test_io.rb
(test_copy_stream_no_busy_wait), it may not be possible to
measure with <= 10ms resolution on 100HZ systems (CONFIG_HZ in
the Linux kernel). So increase the threshold to 15ms (10ms +
5ms slack for slow systems).
* test/lib/test/unit/assertions.rb (assert_cpu_usage_low):
increase pct default value [ruby-core:81427]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/lib/test/unit/assertions.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/lib/test/unit/assertions.rb b/test/lib/test/unit/assertions.rb index 92f754064a..fcd9795402 100644 --- a/test/lib/test/unit/assertions.rb +++ b/test/lib/test/unit/assertions.rb @@ -715,7 +715,7 @@ eom skip end - def assert_cpu_usage_low(msg = nil, pct: 0.005) + def assert_cpu_usage_low(msg = nil, pct: 0.015) require 'benchmark' tms = Benchmark.measure(msg || '') { yield } max = pct * tms.real |