From 05bb854931e77474a29031abdd9bc21838496548 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 1 Jul 2014 08:20:39 +0000 Subject: [PATCH] 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 --- test/rubygems/test_gem_remote_fetcher.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/rubygems/test_gem_remote_fetcher.rb b/test/rubygems/test_gem_remote_fetcher.rb index 79f3a58bfb..aabd0c9308 100644 --- a/test/rubygems/test_gem_remote_fetcher.rb +++ b/test/rubygems/test_gem_remote_fetcher.rb @@ -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