diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-06-07 19:57:46 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-06-07 19:57:46 +0000 |
commit | 85521e60eef7eee999cf1c0c0e460cabdeaa6f7f (patch) | |
tree | 45a563ae8fba7d02fcbf26958150b06bacba83f3 /bootstraptest/test_io.rb | |
parent | 7d8fc3696ef8fa9f600d1943afe2f525debc5564 (diff) | |
download | ruby-85521e60eef7eee999cf1c0c0e460cabdeaa6f7f.tar.gz |
bootstraptest/test_{fork,io,thread}.rb: reduce sleep times
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46379 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bootstraptest/test_io.rb')
-rw-r--r-- | bootstraptest/test_io.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/bootstraptest/test_io.rb b/bootstraptest/test_io.rb index f7360f34b3..cee8cb399e 100644 --- a/bootstraptest/test_io.rb +++ b/bootstraptest/test_io.rb @@ -2,9 +2,8 @@ assert_finish 5, %q{ r, w = IO.pipe t1 = Thread.new { r.sysread(1) } t2 = Thread.new { r.sysread(1) } - sleep 0.1 + sleep 0.01 until t1.stop? and t2.stop? w.write "a" - sleep 0.1 w.write "a" }, '[ruby-dev:31866]' @@ -34,9 +33,9 @@ assert_finish 10, %q{ assert_finish 1, %q{ r, w = IO.pipe Thread.new { - w << "ab" - sleep 0.1 - w << "ab" + w << "ab" + sleep 0.01 + w << "ab" } r.gets("abab") } @@ -91,7 +90,8 @@ assert_normal_exit %q{ megacontent = "abc" * 12345678 #File.open("megasrc", "w") {|f| f << megacontent } - Thread.new { sleep rand*0.2; Process.kill(:INT, $$) } + t0 = Thread.main + Thread.new { sleep 0.001 until t0.stop?; Process.kill(:INT, $$) } r1, w1 = IO.pipe r2, w2 = IO.pipe |