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
This commit is contained in:
nobu 2014-07-02 07:59:31 +00:00
Родитель 02ddcb4b66
Коммит 54336ee19a
1 изменённых файлов: 3 добавлений и 0 удалений

Просмотреть файл

@ -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