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

ruby-changes:39353

From: nobu <ko1@a...>
Date: Wed, 29 Jul 2015 21:45:46 +0900 (JST)
Subject: [ruby-changes:39353] nobu:r51434 (trunk): test_pair.rb: thread leak

nobu	2015-07-29 21:45:32 +0900 (Wed, 29 Jul 2015)

  New Revision: 51434

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

  Log:
    test_pair.rb: thread leak
    
    * test/openssl/test_pair.rb (test_ecdh_callback): join client
      thread before closing sockets.

  Modified files:
    trunk/test/openssl/test_pair.rb
Index: test/openssl/test_pair.rb
===================================================================
--- test/openssl/test_pair.rb	(revision 51433)
+++ test/openssl/test_pair.rb	(revision 51434)
@@ -301,6 +301,7 @@ module OpenSSL::TestPairM https://github.com/ruby/ruby/blob/trunk/test/openssl/test_pair.rb#L301
     assert_equal s1, t.value
     assert accept
   ensure
+    t.join
     s1.close if s1
     s2.close if s2
     sock1.close if sock1
@@ -324,6 +325,7 @@ module OpenSSL::TestPairM https://github.com/ruby/ruby/blob/trunk/test/openssl/test_pair.rb#L325
     assert_equal s1, t.value
     assert accept
   ensure
+    t.join
     s1.close if s1
     s2.close if s2
     sock1.close if sock1
@@ -363,12 +365,12 @@ module OpenSSL::TestPairM https://github.com/ruby/ruby/blob/trunk/test/openssl/test_pair.rb#L365
 
     assert called, 'ecdh callback should be called'
   ensure
+    th.join
     s1.close if s1
     s2.close if s2
     sock1.close if sock1
     sock2.close if sock2
     accepted.close if accepted.respond_to?(:close)
-    th.join rescue nil
   end
 
   def test_connect_accept_nonblock_no_exception
@@ -411,6 +413,7 @@ module OpenSSL::TestPairM https://github.com/ruby/ruby/blob/trunk/test/openssl/test_pair.rb#L413
       assert_includes([s1, :wait_readable, :wait_writable ], rv)
     end
   ensure
+    th.join
     s1.close if s1
     s2.close if s2
     sock1.close if sock1

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

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