mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
test_gem_remote_fetcher.rb: fix leaked threads
* test/rubygems/test_gem_remote_fetcher.rb (stop_servers): kill server threads to fix leaked threads. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46636 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e2e4ac3a8f
commit
05bb854931
1 changed files with 17 additions and 0 deletions
|
@ -108,6 +108,7 @@ gems:
|
|||
end
|
||||
|
||||
def teardown
|
||||
self.class.stop_servers
|
||||
super
|
||||
Gem.configuration[:http_proxy] = nil
|
||||
@proxies.each_with_index {|k, i| ENV[k] = @old_proxies[i] }
|
||||
|
@ -712,6 +713,21 @@ gems:
|
|||
@enable_zip = false
|
||||
end
|
||||
|
||||
def stop_servers
|
||||
if @normal_server
|
||||
@normal_server.kill.join
|
||||
@normal_server = nil
|
||||
end
|
||||
if @proxy_server
|
||||
@proxy_server.kill.join
|
||||
@proxy_server = nil
|
||||
end
|
||||
if @ssl_server
|
||||
@ssl_server.kill.join
|
||||
@ssl_server = nil
|
||||
end
|
||||
end
|
||||
|
||||
def normal_server_port
|
||||
@normal_server[:server].config[:Port]
|
||||
end
|
||||
|
@ -760,6 +776,7 @@ gems:
|
|||
raise
|
||||
end
|
||||
end
|
||||
@ssl_server = t
|
||||
server
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue