Skip to content

Commit

Permalink
test/openssl/test_ssl: fix flaky test case
Browse files Browse the repository at this point in the history
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: 98f8787 ("test/openssl/test_ssl: fix random failure in
SSLSocket.open test", 2020-02-17)
  • Loading branch information
rhenium committed May 13, 2020
1 parent 016a4f8 commit 413b155
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/openssl/test_ssl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def test_socket_open_with_local_address_port_context
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
Expand Down

0 comments on commit 413b155

Please sign in to comment.