summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYusuke Endoh <mame@ruby-lang.org>2020-03-21 15:46:33 +0900
committerYusuke Endoh <mame@ruby-lang.org>2020-03-21 15:46:33 +0900
commitbe76e86e69106c6906322dc30aa75c3ff65da63c (patch)
tree011c70b5ae12810fe0e2bb0591d4ec9bd42a80df
parent39cefa64d2b8f256ba6e3ed36e0def963aad9b06 (diff)
test/openssl/test_ssl.rb: ignore SSLError when the connection is closed
"test_close_after_socket_close" checks if ssl.close is no-op even after the wrapped socket is closed. The test itself is fair, but the other endpoint that is reading the SSL connection may fail with SSLError: "SSL_read: unexpected eof while reading" in some environments: https://github.com/ruby/ruby/actions/runs/60085389 (MinGW) https://rubyci.org/logs/rubyci.s3.amazonaws.com/android28-x86_64/ruby-master/log/20200321T034442Z.fail.html.gz ``` 1) Failure: OpenSSL::TestSSL#test_close_after_socket_close [D:/a/ruby/ruby/src/test/openssl/utils.rb:299]: exceptions on 1 threads: SSL_read: unexpected eof while reading ``` This changeset rescues and ignores the SSLError in the test.
-rw-r--r--test/openssl/test_ssl.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/openssl/test_ssl.rb b/test/openssl/test_ssl.rb
index ce899ba..4598927 100644
--- a/test/openssl/test_ssl.rb
+++ b/test/openssl/test_ssl.rb
@@ -1398,8 +1398,13 @@ end
}
end
+ def readwrite_loop_safe(ctx, ssl)
+ readwrite_loop(ctx, ssl)
+ rescue OpenSSL::SSL::SSLError
+ end
+
def test_close_after_socket_close
- start_server { |port|
+ start_server(server_proc: method(:readwrite_loop_safe)) { |port|
sock = TCPSocket.new("127.0.0.1", port)
ssl = OpenSSL::SSL::SSLSocket.new(sock)
ssl.connect