summaryrefslogtreecommitdiff
path: root/test/openssl/test_ssl.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/openssl/test_ssl.rb')
-rw-r--r--test/openssl/test_ssl.rb19
1 files changed, 12 insertions, 7 deletions
diff --git a/test/openssl/test_ssl.rb b/test/openssl/test_ssl.rb
index 50659f1b3b0..876ca4c6856 100644
--- a/test/openssl/test_ssl.rb
+++ b/test/openssl/test_ssl.rb
@@ -128,14 +128,19 @@ class OpenSSL::TestSSL < Test::Unit::TestCase
block.call(server, port.to_i)
ensure
- tcps.close if (tcps)
- if (server)
- server.join(5)
- if server.alive?
- server.kill
- server.join
- flunk("TCPServer was closed and SSLServer is still alive") unless $!
+ tcps.shutdown if (tcps)
+ begin
+ if (server)
+ server.join(5)
+ if server.alive?
+ server.kill
+ server.join
+ flunk("TCPServer was closed and SSLServer is still alive") unless $!
+ end
end
+ rescue Errno::EINVAL, Errno::EBADF
+ ensure
+ tcps.close if (tcps)
end
end
end