summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-07-02 07:59:31 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-07-02 07:59:31 +0000
commit54336ee19ac75b8b083fdb58c3d6ddd8b4c3dc60 (patch)
tree3cb80a108c7f90130457da1a82d4536da0a90c4e /test
parent02ddcb4b66d4d3348d2f4d4178467e4ad836cbf9 (diff)
test_io.rb: fix leaked threads
* test/ruby/test_io.rb (test_readpartial_locktmp): ensure reading thread is dead to fix leaked threads. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46655 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_io.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb
index fab142a5ee..a3252d88b7 100644
--- a/test/ruby/test_io.rb
+++ b/test/ruby/test_io.rb
@@ -2853,6 +2853,7 @@ End
bug6099 = '[ruby-dev:45297]'
buf = " " * 100
data = "a" * 100
+ th = nil
with_pipe do |r,w|
r.fcntl(Fcntl::F_SETFL, Fcntl::O_NONBLOCK)
th = Thread.new {r.readpartial(100, buf)}
@@ -2865,6 +2866,8 @@ End
end
assert_equal(data, buf, bug6099)
rescue RuntimeError # can't modify string; temporarily locked
+ ensure
+ th.join if th
end
def test_advise_pipe