Allow Errno::EACCES when testing connection timeout

Some packaging systems that include support for running tests,
such as OpenBSD's, do not allow outbound network connections
during testing for security reasons. EACCES is the error raised by
OpenBSD in this case.
This commit is contained in:
Jeremy Evans 2024-09-03 18:21:01 -07:00 committed by GitHub
parent 974b404327
commit 08f14b8d4c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
Notes: git 2024-09-04 01:21:21 +00:00
Merged: https://github.com/ruby/ruby/pull/11535

Merged-By: jeremyevans <code@jeremyevans.net>

View File

@ -70,7 +70,7 @@ class TestSocket_TCPSocket < Test::Unit::TestCase
end
def test_initialize_connect_timeout
assert_raise(IO::TimeoutError, Errno::ENETUNREACH) do
assert_raise(IO::TimeoutError, Errno::ENETUNREACH, Errno::EACCES) do
TCPSocket.new("192.0.2.1", 80, connect_timeout: 0)
end
end