[前][次][番号順一覧][スレッド一覧]

ruby-changes:34555

From: nobu <ko1@a...>
Date: Tue, 1 Jul 2014 17:20:44 +0900 (JST)
Subject: [ruby-changes:34555] nobu:r46636 (trunk): test_gem_remote_fetcher.rb: fix leaked threads

nobu	2014-07-01 17:20:39 +0900 (Tue, 01 Jul 2014)

  New Revision: 46636

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=46636

  Log:
    test_gem_remote_fetcher.rb: fix leaked threads
    
    * test/rubygems/test_gem_remote_fetcher.rb (stop_servers): kill
      server threads to fix leaked threads.

  Modified files:
    trunk/test/rubygems/test_gem_remote_fetcher.rb
Index: test/rubygems/test_gem_remote_fetcher.rb
===================================================================
--- test/rubygems/test_gem_remote_fetcher.rb	(revision 46635)
+++ test/rubygems/test_gem_remote_fetcher.rb	(revision 46636)
@@ -108,6 +108,7 @@ gems: https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_remote_fetcher.rb#L108
   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: https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_remote_fetcher.rb#L713
       @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: https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_remote_fetcher.rb#L776
           raise
         end
       end
+      @ssl_server = t
       server
     end
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]