test_pair.rb: thread leak
* test/openssl/test_pair.rb (test_ecdh_callback): join client thread before closing sockets. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51434 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
621bf532fc
commit
b729e9278f
@ -301,6 +301,7 @@ module OpenSSL::TestPairM
|
|||||||
assert_equal s1, t.value
|
assert_equal s1, t.value
|
||||||
assert accept
|
assert accept
|
||||||
ensure
|
ensure
|
||||||
|
t.join
|
||||||
s1.close if s1
|
s1.close if s1
|
||||||
s2.close if s2
|
s2.close if s2
|
||||||
sock1.close if sock1
|
sock1.close if sock1
|
||||||
@ -324,6 +325,7 @@ module OpenSSL::TestPairM
|
|||||||
assert_equal s1, t.value
|
assert_equal s1, t.value
|
||||||
assert accept
|
assert accept
|
||||||
ensure
|
ensure
|
||||||
|
t.join
|
||||||
s1.close if s1
|
s1.close if s1
|
||||||
s2.close if s2
|
s2.close if s2
|
||||||
sock1.close if sock1
|
sock1.close if sock1
|
||||||
@ -363,12 +365,12 @@ module OpenSSL::TestPairM
|
|||||||
|
|
||||||
assert called, 'ecdh callback should be called'
|
assert called, 'ecdh callback should be called'
|
||||||
ensure
|
ensure
|
||||||
|
th.join
|
||||||
s1.close if s1
|
s1.close if s1
|
||||||
s2.close if s2
|
s2.close if s2
|
||||||
sock1.close if sock1
|
sock1.close if sock1
|
||||||
sock2.close if sock2
|
sock2.close if sock2
|
||||||
accepted.close if accepted.respond_to?(:close)
|
accepted.close if accepted.respond_to?(:close)
|
||||||
th.join rescue nil
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_connect_accept_nonblock_no_exception
|
def test_connect_accept_nonblock_no_exception
|
||||||
@ -411,6 +413,7 @@ module OpenSSL::TestPairM
|
|||||||
assert_includes([s1, :wait_readable, :wait_writable ], rv)
|
assert_includes([s1, :wait_readable, :wait_writable ], rv)
|
||||||
end
|
end
|
||||||
ensure
|
ensure
|
||||||
|
th.join
|
||||||
s1.close if s1
|
s1.close if s1
|
||||||
s2.close if s2
|
s2.close if s2
|
||||||
sock1.close if sock1
|
sock1.close if sock1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user