From 54336ee19ac75b8b083fdb58c3d6ddd8b4c3dc60 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 2 Jul 2014 07:59:31 +0000 Subject: 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 --- test/ruby/test_io.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'test/ruby') 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 -- cgit v1.2.3