diff options
author | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-06-03 01:04:30 +0000 |
---|---|---|
committer | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-06-03 01:04:30 +0000 |
commit | e6e292121aa7fda4e663c3dd81d11538a7bd2341 (patch) | |
tree | 9fce9541156b6adb9176ee0a7d6ac2f5a68ad505 /test/ruby | |
parent | 038c2e52d891acafeff0710aed8c95a10cc5b688 (diff) | |
download | ruby-e6e292121aa7fda4e663c3dd81d11538a7bd2341.tar.gz |
test: attempt to reduce failures in assert_cpu_usage_low
Try to make this test less fragile by taking into account
the worst case kernel timing resolution.
[ruby-core:81540]
* test/lib/test/unit/assertions.rb (assert_cpu_usage_low):
clamp measurement to minimum measurable time and warn
about tests being too short to measure
* test/ruby/test_io.rb (test_copy_stream_no_busy_wait):
remove pct kwarg and rely on assert_cpu_usage_low defaults
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59003 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_io.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index 5c98a59be0..2cd60a4fca 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -536,7 +536,7 @@ class TestIO < Test::Unit::TestCase msg = 'r58534 [ruby-core:80969] [Backport #13533]' IO.pipe do |r,w| r.nonblock = true - assert_cpu_usage_low(msg, pct: 0.11) do + assert_cpu_usage_low(msg) do th = Thread.new { IO.copy_stream(r, IO::NULL) } sleep 0.1 w.close |