mirror of
https://github.com/ruby/ruby.git
synced 2025-08-26 14:34:39 +02:00
test/ruby/test_io.rb: adjust CPU usage check to 10%
I miscalculated for r58934, since we sleep 100ms, and the worst possible case is 100 Hz in the kernel meaning we only have 10ms resolution. So, we need to increase our CPU percentage to >= 10% for this. This should be more than enough for our CI machines which have 300 Hz kernels [ruby-core:81429]: http://ci.rvm.jp/results/trunk-test@sasada-8core/1495942555 * test/ruby/test_io.rb (test_copy_stream_no_busy_wait): override default percentage git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58936 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
253232c028
commit
a028cfc597
1 changed files with 2 additions and 1 deletions
|
@ -533,9 +533,10 @@ class TestIO < Test::Unit::TestCase
|
||||||
|
|
||||||
if have_nonblock?
|
if have_nonblock?
|
||||||
def test_copy_stream_no_busy_wait
|
def test_copy_stream_no_busy_wait
|
||||||
|
msg = 'r58534 [ruby-core:80969] [Backport #13533]'
|
||||||
IO.pipe do |r,w|
|
IO.pipe do |r,w|
|
||||||
r.nonblock = true
|
r.nonblock = true
|
||||||
assert_cpu_usage_low('r58534 [ruby-core:80969] [Backport #13533]') do
|
assert_cpu_usage_low(msg, pct: 0.11) do
|
||||||
th = Thread.new { IO.copy_stream(r, IO::NULL) }
|
th = Thread.new { IO.copy_stream(r, IO::NULL) }
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
w.close
|
w.close
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue