summaryrefslogtreecommitdiff
path: root/bootstraptest/test_io.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-05 02:43:15 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-05 02:43:15 +0000
commita6242670f358b55ef075f13dae325b64e9a55e5f (patch)
treeccdff5877febb353cef493324d852c8020d009ce /bootstraptest/test_io.rb
parent62d7a30a769e0fb90233a9b1d6ff18cc1409ead0 (diff)
* bootstraptest/test_io.rb (megacontent-copy_stream): get rid of
deadlock. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27623 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bootstraptest/test_io.rb')
-rw-r--r--bootstraptest/test_io.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/bootstraptest/test_io.rb b/bootstraptest/test_io.rb
index d2e02a0659..7304aebc26 100644
--- a/bootstraptest/test_io.rb
+++ b/bootstraptest/test_io.rb
@@ -78,7 +78,7 @@ assert_normal_exit %q{
ARGF.set_encoding "foo"
}
-1.times do
+10.times do
assert_normal_exit %q{
at_exit { p :foo }
@@ -90,11 +90,13 @@ assert_normal_exit %q{
r1, w1 = IO.pipe
r2, w2 = IO.pipe
t1 = Thread.new { w1 << megacontent; w1.close }
- t2 = Thread.new { r2.read }
+ t2 = Thread.new { r2.read; r2.close }
IO.copy_stream(r1, w2) rescue nil
- r2.close; w2.close
- r1.close; w1.close
- }, '', ["INT"] or break
+ w2.close
+ r1.close
+ t1.join
+ t2.join
+ }, 'megacontent-copy_stream', ["INT"], :timeout => 10 or break
end
assert_normal_exit %q{