ruby-changes:34052
From: nobu <ko1@a...>
Date: Mon, 26 May 2014 14:38:28 +0900 (JST)
Subject: [ruby-changes:34052] nobu:r46133 (trunk): test_http.rb: fix leaked threads
nobu 2014-05-26 14:38:12 +0900 (Mon, 26 May 2014) New Revision: 46133 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=46133 Log: test_http.rb: fix leaked threads * test/net/http/test_http.rb (test_timeout_during_HTTP_session): join work threads not to leak threads. Modified files: trunk/test/net/http/test_http.rb Index: test/net/http/test_http.rb =================================================================== --- test/net/http/test_http.rb (revision 46132) +++ test/net/http/test_http.rb (revision 46133) @@ -397,6 +397,7 @@ module TestNetHTTP_version_1_1_methods https://github.com/ruby/ruby/blob/trunk/test/net/http/test_http.rb#L397 def test_timeout_during_HTTP_session bug4246 = "expected the HTTP session to have timed out but have not. c.f. [ruby-core:34203]" + th = nil # listen for connections... but deliberately do not read TCPServer.open('localhost', 0) {|server| port = server.addr[1] @@ -412,6 +413,9 @@ module TestNetHTTP_version_1_1_methods https://github.com/ruby/ruby/blob/trunk/test/net/http/test_http.rb#L413 end assert th.join(10), bug4246 } + ensure + th.kill + th.join end end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/