DEV: Use same Socket.getaddrinfo arguments as selenium-webdriver (#27301)

Follow up to c408b53689. We need better
debugging information
This commit is contained in:
Alan Guo Xiang Tan 2024-06-03 13:11:40 +08:00 committed by GitHub
parent 23c38cbf11
commit d68983e060
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -523,13 +523,22 @@ RSpec.configure do |config|
example.run example.run
if example.exception.is_a?(Socket::ResolutionError) if example.exception.is_a?(Socket::ResolutionError)
info = Socket.getaddrinfo("localhost", nil) info = Socket.getaddrinfo("localhost", 80, Socket::AF_INET, Socket::SOCK_STREAM)
etc_hosts = `cat /etc/hosts` etc_hosts = `cat /etc/hosts`
resolve_conf = `cat /etc/resolv.conf`
nsswitch = `cat /etc/nsswitch.conf`
puts <<~MSG puts <<~MSG
Failed to resolve localhost, available addresses: #{info} Failed to resolve localhost, available addresses: #{info}
/etc/hosts: /etc/hosts:
#{etc_hosts} #{etc_hosts}
/etc/resolv.conf:
#{resolve_conf}
/etc/nsswitch.conf:
#{nsswitch}
MSG MSG
end end
end end