diff options
Diffstat (limited to 'test/ruby/test_io.rb')
-rw-r--r-- | test/ruby/test_io.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index 2b82470b8c..5d14aae601 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -532,6 +532,18 @@ class TestIO < Test::Unit::TestCase end if have_nonblock? + def test_copy_stream_no_busy_wait + IO.pipe do |r,w| + r.nonblock = true + assert_cpu_usage_low('r58534 [ruby-core:80969] [Backport #13533]') do + th = Thread.new { IO.copy_stream(r, IO::NULL) } + sleep 0.1 + w.close + th.join + end + end + end + def test_copy_stream_pipe_nonblock mkcdtmpdir { with_read_pipe("abc") {|r1| |