From 91c6c2c170698577b4618139181f57f3874f5a9c Mon Sep 17 00:00:00 2001 From: ko1 Date: Fri, 21 Dec 2007 09:43:49 +0000 Subject: * io.c: write() should be in blocking region. * bootstraptest/test_io.rb, test_knownbug.rb: move a fixed test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14428 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- bootstraptest/test_io.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'bootstraptest/test_io.rb') diff --git a/bootstraptest/test_io.rb b/bootstraptest/test_io.rb index e62b9d15a2..20a441de9f 100644 --- a/bootstraptest/test_io.rb +++ b/bootstraptest/test_io.rb @@ -7,3 +7,19 @@ assert_finish 5, %q{ sleep 0.1 w.write "a" }, '[ruby-dev:31866]' + +assert_finish 10, %q{ + require "io/nonblock" + r, w = IO.pipe + w.nonblock = true + w.write_nonblock("a" * 100000) + w.nonblock = false + t1 = Thread.new { w.write("b" * 4096) } + t2 = Thread.new { w.write("c" * 4096) } + sleep 0.5 + r.sysread(4096).length + sleep 0.5 + r.sysread(4096).length + t1.join + t2.join +}, '[ruby-dev:32566]' -- cgit v1.2.3