diff options
| author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-07-21 16:36:41 +0000 |
|---|---|---|
| committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-07-21 16:36:41 +0000 |
| commit | 6978527c768c5a09d0e1e9ad67281447abca0e2b (patch) | |
| tree | be6cc600d7c2ea25fd87dfb323c8614ddcaf73f5 | |
| parent | 7a01bdaea8d9e8aacb05134bb8387177ef4c8db4 (diff) | |
| download | ruby-6978527c768c5a09d0e1e9ad67281447abca0e2b.tar.gz ruby-6978527c768c5a09d0e1e9ad67281447abca0e2b.tar.xz ruby-6978527c768c5a09d0e1e9ad67281447abca0e2b.zip | |
* bootstraptest/test_io.rb: block write may block for long time.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24232 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | bootstraptest/test_io.rb | 29 |
2 files changed, 20 insertions, 14 deletions
@@ -1,3 +1,7 @@ +Wed Jul 22 01:20:54 2009 Yukihiro Matsumoto <matz@ruby-lang.org> + + * bootstraptest/test_io.rb: block write may block for long time. + Wed Jul 22 00:34:39 2009 Keiju Ishitsuka <keiju@ruby-lang.org> * lib/irb.rb, lib/irb/init.rb, lib/irb/ext/save-history.rb: add @@ -14,7 +18,6 @@ Tue Jul 21 21:37:19 2009 Keiju Ishitsuka <keiju@ruby-lang.org> * lib/irb/cmd/help.rb: fixed irb's "help" command. [ruby-core:22310]. -Tue Jul 21 20:41:20 2009 Keiju Ishitsuka <keiju@ruby-lang.org> * lib/tracer.rb: no show lines unkonwn line number. [ruby-core:22096], no trace display c-call and c-return as default. diff --git a/bootstraptest/test_io.rb b/bootstraptest/test_io.rb index 83b38f8cc..229465421 100644 --- a/bootstraptest/test_io.rb +++ b/bootstraptest/test_io.rb @@ -11,19 +11,22 @@ assert_finish 5, %q{ assert_finish 10, %q{ begin 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 - rescue LoadError + require "timeout" + timeout(3) do + 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 + end + rescue LoadError, TimeoutError end }, '[ruby-dev:32566]' |
