Skip to content

test_dns: Fix failure on Windows #58

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions test/resolv/test_dns.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def with_udp(host, port)
def with_udp_and_tcp(host, port)
if port == 0
# Automatic port; we might need to retry until we find a port which is free on both UDP _and_ TCP.
retries_remaining = 5
retries_remaining = 10
t = nil
u = nil
begin
Expand Down Expand Up @@ -709,7 +709,8 @@ def test_multiple_servers_with_timeout_and_truncated_tcp_fallback
num_records = 50

with_udp_and_tcp('127.0.0.1', 0) do |u1, t1|
with_tcp('0.0.0.0', 0) do |t2|
with_udp_and_tcp('127.0.0.1', 0) do |u2,t2|
u2.close # XXX: u2 UDP socket is not used, but using #with_udp_and_tcp to enable Windows EACCES workaround
_, server1_port, _, server1_address = u1.addr
_, server2_port, _, server2_address = t2.addr

Expand Down