summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMisaki Shioi <shioi.mm@gmail.com>2023-12-01 09:31:33 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2023-12-01 12:20:03 +0900
commit1bfd30a1e3fa2c1d2729667ed698b7c604c2a1bd (patch)
treedb7ba09e9d619d7e69eff94958a088effaff5edb
parente2bbbacc233b1b1c13298baff9eacfe1ef0052f4 (diff)
Relax test conditions to velify Socket::ResolutionError#error_code
The test for Socket::ResolutionError#error_code fails in the FreeBSD environment with this test condition. Because Socket::ResolutionError#error_code returns Socket::EAI_FAIL instead of Socket::EAI_FAMILY. https://rubyci.s3.amazonaws.com/freebsd12/ruby-master/log/20231130T103002Z.fail.html.gz This PR avoids the test failure by relaxing the condition. Also changed the domain for testing to `example.com`.
-rw-r--r--test/socket/test_socket.rb7
1 files changed, 2 insertions, 5 deletions
diff --git a/test/socket/test_socket.rb b/test/socket/test_socket.rb
index cdc9929bb6..6c3d6e198a 100644
--- a/test/socket/test_socket.rb
+++ b/test/socket/test_socket.rb
@@ -771,13 +771,10 @@ class TestSocket < Test::Unit::TestCase
end
def test_resolurion_error_error_code
- # https://rubyci.s3.amazonaws.com/freebsd12/ruby-master/log/20231130T103002Z.fail.html.gz
- omit if /freebsd/ =~ RUBY_PLATFORM
-
begin
- Socket.getaddrinfo("www.kame.net", 80, "AF_UNIX")
+ Socket.getaddrinfo("example.com", 80, "AF_UNIX")
rescue => e
- assert_equal(Socket::EAI_FAMILY, e.error_code)
+ assert_equal([Socket::EAI_FAMILY, Socket::EAI_FAIL].include?(e.error_code), true)
end
end