[ruby/openssl] test/openssl/test_ssl: fix flaky test case

Fix test_socket_open_with_local_address_port_context.

Often with MinGW, it seems EACCES is returned on bind when the port
number is unavailable. Ignore it just as we do for EADDRINUSE and
continue searching free port number.

Fixes: 98f8787b4687 ("test/openssl/test_ssl: fix random failure in
SSLSocket.open test", 2020-02-17)

https://github.com/ruby/openssl/commit/413b15526e
This commit is contained in:
Kazuki Yamaguchi 2020-05-13 16:37:16 +09:00
parent 498c8e8f17
commit d60ab95398
Notes: git 2021-03-16 20:38:53 +09:00

View File

@ -99,7 +99,7 @@ class OpenSSL::TestSSL < OpenSSL::SSLTestCase
assert_equal ctx, ssl.context
assert_equal random_port, ssl.io.local_address.ip_port
ssl.puts "abc"; assert_equal "abc\n", ssl.gets
rescue Errno::EADDRINUSE
rescue Errno::EADDRINUSE, Errno::EACCES
ensure
ssl&.close
end