зеркало из https://github.com/github/ruby.git
test_http.rb: fix leaked threads
* test/net/http/test_http.rb (test_timeout_during_HTTP_session): join work threads not to leak threads. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
6fb6491c29
Коммит
3041f72833
|
@ -397,6 +397,7 @@ module TestNetHTTP_version_1_1_methods
|
|||
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
|
|||
end
|
||||
assert th.join(10), bug4246
|
||||
}
|
||||
ensure
|
||||
th.kill
|
||||
th.join
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче