summaryrefslogtreecommitdiff
path: root/test/io/wait/test_io_wait.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-30 13:48:06 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-30 13:48:06 +0000
commitab4c6921cb97be13be874a78a5a0bcc450ca9b84 (patch)
tree00a22a49db1aa1571f34254bf7c0ee5bc7c69c0d /test/io/wait/test_io_wait.rb
parent5b75a0614f6469785bdf5f548fd3db2dae820ae2 (diff)
Join threads.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46256 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/io/wait/test_io_wait.rb')
-rw-r--r--test/io/wait/test_io_wait.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/io/wait/test_io_wait.rb b/test/io/wait/test_io_wait.rb
index 46097e00c69..9d883aa8218 100644
--- a/test/io/wait/test_io_wait.rb
+++ b/test/io/wait/test_io_wait.rb
@@ -62,13 +62,17 @@ class TestIOWait < Test::Unit::TestCase
end
def test_wait_forever
- Thread.new { sleep 0.01; @w.syswrite "." }
+ th = Thread.new { sleep 0.01; @w.syswrite "." }
assert_equal @r, @r.wait
+ ensure
+ th.join
end
def test_wait_eof
- Thread.new { sleep 0.01; @w.close }
+ th = Thread.new { sleep 0.01; @w.close }
assert_nil @r.wait
+ ensure
+ th.join
end
def test_wait_writable