<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/resolv/test_dns.rb, branch v3_4_9</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>Bump up resolv-0.6.2 for Ruby 3.4 (#13818)</title>
<updated>2025-07-08T16:32:36+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2025-07-08T16:32:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=5cd408a52ef6e31b16aeee548c900438dc560637'/>
<id>5cd408a52ef6e31b16aeee548c900438dc560637</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/resolv] Omit Windows and MinGW platforms with with_udp_and_tcp</title>
<updated>2024-11-26T02:44:00+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2024-11-26T02:28:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=c08e1f336c95ad4e13e20d29980f11f67334affe'/>
<id>c08e1f336c95ad4e13e20d29980f11f67334affe</id>
<content type='text'>
https://github.com/ruby/resolv/actions/runs/12021339854/job/33511655994?pr=64

```
  =&gt; 705:     with_udp_and_tcp('127.0.0.1', 0) do |u1, t1|
     706:       with_udp_and_tcp('127.0.0.1', 0) do |u2,t2|
     707:         u2.close # XXX: u2 UDP socket is not used, but using #with_udp_and_tcp to enable Windows EACCES workaround
     708:         _, server1_port, _, server1_address = u1.addr
Error: Errno::EACCES: Permission denied - bind(2) for "127.0.0.1" port 55685
```

https://github.com/ruby/ruby/actions/runs/12005069051/job/33461068529?pr=12161

```
    1) Error:
  TestResolvDNS#test_multiple_servers_with_timeout_and_truncated_tcp_fallback:
  Errno::EACCES: Permission denied - bind(2) for "127.0.0.1" port 50676
      D:/a/ruby/ruby/src/test/resolv/test_dns.rb:78:in 'TCPServer#initialize'
      D:/a/ruby/ruby/src/test/resolv/test_dns.rb:78:in 'TCPServer.new'
      D:/a/ruby/ruby/src/test/resolv/test_dns.rb:78:in 'TestResolvDNS#with_udp_and_tcp'
      D:/a/ruby/ruby/src/test/resolv/test_dns.rb:705:in 'TestResolvDNS#test_multiple_servers_with_timeout_and_truncated_tcp_fallback'
```

https://github.com/ruby/resolv/commit/05765df178
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/resolv/actions/runs/12021339854/job/33511655994?pr=64

```
  =&gt; 705:     with_udp_and_tcp('127.0.0.1', 0) do |u1, t1|
     706:       with_udp_and_tcp('127.0.0.1', 0) do |u2,t2|
     707:         u2.close # XXX: u2 UDP socket is not used, but using #with_udp_and_tcp to enable Windows EACCES workaround
     708:         _, server1_port, _, server1_address = u1.addr
Error: Errno::EACCES: Permission denied - bind(2) for "127.0.0.1" port 55685
```

https://github.com/ruby/ruby/actions/runs/12005069051/job/33461068529?pr=12161

```
    1) Error:
  TestResolvDNS#test_multiple_servers_with_timeout_and_truncated_tcp_fallback:
  Errno::EACCES: Permission denied - bind(2) for "127.0.0.1" port 50676
      D:/a/ruby/ruby/src/test/resolv/test_dns.rb:78:in 'TCPServer#initialize'
      D:/a/ruby/ruby/src/test/resolv/test_dns.rb:78:in 'TCPServer.new'
      D:/a/ruby/ruby/src/test/resolv/test_dns.rb:78:in 'TestResolvDNS#with_udp_and_tcp'
      D:/a/ruby/ruby/src/test/resolv/test_dns.rb:705:in 'TestResolvDNS#test_multiple_servers_with_timeout_and_truncated_tcp_fallback'
```

https://github.com/ruby/resolv/commit/05765df178
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/resolv] _1 is not provided in Ruby 2.5</title>
<updated>2024-11-26T00:28:06+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2024-11-26T00:22:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=36f67f6bbbacb242e2c9e8fbd6d07ac706287ba2'/>
<id>36f67f6bbbacb242e2c9e8fbd6d07ac706287ba2</id>
<content type='text'>
https://github.com/ruby/resolv/commit/83f18e2a49
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/resolv/commit/83f18e2a49
</pre>
</div>
</content>
</entry>
<entry>
<title>test/resolv/test_dns.rb: Keep `UDPSocket`s until a free port is found</title>
<updated>2024-10-10T05:44:51+00:00</updated>
<author>
<name>Yusuke Endoh</name>
<email>mame@ruby-lang.org</email>
</author>
<published>2024-10-10T05:14:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=15bb571730c4c19def9c4e1d59c9546056d9bd98'/>
<id>15bb571730c4c19def9c4e1d59c9546056d9bd98</id>
<content type='text'>
Follow up to 589f1978d8c368b8eccf34453463ad46a58d36da

I suspect `UDPSocket.new` grabs the same port number because they are
closed at each trial.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Follow up to 589f1978d8c368b8eccf34453463ad46a58d36da

I suspect `UDPSocket.new` grabs the same port number because they are
closed at each trial.
</pre>
</div>
</content>
</entry>
<entry>
<title>mingw environment can't bind free port with 10 times. We should omit it instead of test failure.</title>
<updated>2024-10-09T02:28:40+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2024-10-09T01:57:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=589f1978d8c368b8eccf34453463ad46a58d36da'/>
<id>589f1978d8c368b8eccf34453463ad46a58d36da</id>
<content type='text'>
```
 1) Error:
  TestResolvDNS#test_multiple_servers_with_timeout_and_truncated_tcp_fallback:
  Errno::EACCES: Permission denied - bind(2) for "127.0.0.1" port 59677
      D:/a/ruby/ruby/src/test/resolv/test_dns.rb:78:in 'TCPServer#initialize'
      D:/a/ruby/ruby/src/test/resolv/test_dns.rb:78:in 'TCPServer.new'
      D:/a/ruby/ruby/src/test/resolv/test_dns.rb:78:in 'TestResolvDNS#with_udp_and_tcp'
      D:/a/ruby/ruby/src/test/resolv/test_dns.rb:711:in 'TestResolvDNS#test_multiple_servers_with_timeout_and_truncated_tcp_fallback'

    2) Error:
  TestResolvDNS#test_query_ipv4_address_truncated_tcp_fallback:
  Errno::EACCES: Permission denied - bind(2) for "127.0.0.1" port 59689
      D:/a/ruby/ruby/src/test/resolv/test_dns.rb:78:in 'TCPServer#initialize'
      D:/a/ruby/ruby/src/test/resolv/test_dns.rb:78:in 'TCPServer.new'
      D:/a/ruby/ruby/src/test/resolv/test_dns.rb:78:in 'TestResolvDNS#with_udp_and_tcp'
      D:/a/ruby/ruby/src/test/resolv/test_dns.rb:223:in 'TestResolvDNS#test_query_ipv4_address_truncated_tcp_fallback'
```
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
```
 1) Error:
  TestResolvDNS#test_multiple_servers_with_timeout_and_truncated_tcp_fallback:
  Errno::EACCES: Permission denied - bind(2) for "127.0.0.1" port 59677
      D:/a/ruby/ruby/src/test/resolv/test_dns.rb:78:in 'TCPServer#initialize'
      D:/a/ruby/ruby/src/test/resolv/test_dns.rb:78:in 'TCPServer.new'
      D:/a/ruby/ruby/src/test/resolv/test_dns.rb:78:in 'TestResolvDNS#with_udp_and_tcp'
      D:/a/ruby/ruby/src/test/resolv/test_dns.rb:711:in 'TestResolvDNS#test_multiple_servers_with_timeout_and_truncated_tcp_fallback'

    2) Error:
  TestResolvDNS#test_query_ipv4_address_truncated_tcp_fallback:
  Errno::EACCES: Permission denied - bind(2) for "127.0.0.1" port 59689
      D:/a/ruby/ruby/src/test/resolv/test_dns.rb:78:in 'TCPServer#initialize'
      D:/a/ruby/ruby/src/test/resolv/test_dns.rb:78:in 'TCPServer.new'
      D:/a/ruby/ruby/src/test/resolv/test_dns.rb:78:in 'TestResolvDNS#with_udp_and_tcp'
      D:/a/ruby/ruby/src/test/resolv/test_dns.rb:223:in 'TestResolvDNS#test_query_ipv4_address_truncated_tcp_fallback'
```
</pre>
</div>
</content>
</entry>
<entry>
<title>Specify use_ipv6 option for ipv4 test</title>
<updated>2024-10-08T06:52:49+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2024-10-08T06:23:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=63149cad81e346b8e5cd3d6058e0dfaf4fded731'/>
<id>63149cad81e346b8e5cd3d6058e0dfaf4fded731</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/resolv] test_dns: Fix FD leak</title>
<updated>2024-09-10T08:34:37+00:00</updated>
<author>
<name>Kasumi Hanazuki</name>
<email>kasumi@rollingapple.net</email>
</author>
<published>2024-08-31T07:31:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=3231ac6008bdcfe605b97bf09d79b3e58a2e58a3'/>
<id>3231ac6008bdcfe605b97bf09d79b3e58a2e58a3</id>
<content type='text'>
The listening TCP socket is closed by `with_udp_and_tcp` helper, but
the connected socket is leaking.

```
Leaked file descriptor: TestResolvDNS#test_multiple_servers_with_timeout_and_truncated_tcp_fallback: 12 : #&lt;TCPSocket:fd 12, AF_INET, 127.0.0.1, 50888&gt;
COMMAND     PID     USER   FD   TYPE    DEVICE SIZE/OFF NODE NAME
ruby    3248055 chkbuild   12u  IPv4 112546322      0t0  TCP localhost:50888-&gt;localhost:40112 (CLOSE_WAIT)
```

For the purpose of the test case to simulate a timeout over TCP
transport, we have to delay closing this socket until the end the test
case.

Fixup: https://github.com/ruby/resolv/pull/50

https://github.com/ruby/resolv/commit/236c38bdb1
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The listening TCP socket is closed by `with_udp_and_tcp` helper, but
the connected socket is leaking.

```
Leaked file descriptor: TestResolvDNS#test_multiple_servers_with_timeout_and_truncated_tcp_fallback: 12 : #&lt;TCPSocket:fd 12, AF_INET, 127.0.0.1, 50888&gt;
COMMAND     PID     USER   FD   TYPE    DEVICE SIZE/OFF NODE NAME
ruby    3248055 chkbuild   12u  IPv4 112546322      0t0  TCP localhost:50888-&gt;localhost:40112 (CLOSE_WAIT)
```

For the purpose of the test case to simulate a timeout over TCP
transport, we have to delay closing this socket until the end the test
case.

Fixup: https://github.com/ruby/resolv/pull/50

https://github.com/ruby/resolv/commit/236c38bdb1
</pre>
</div>
</content>
</entry>
<entry>
<title>Suppress warning for fd leak</title>
<updated>2024-08-22T01:38:43+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2024-08-22T00:39:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=8558bea27bdbb68b51d4e67a37e3db95e17fdd73'/>
<id>8558bea27bdbb68b51d4e67a37e3db95e17fdd73</id>
<content type='text'>
```
Leaked file descriptor: TestResolvDNS#test_multiple_servers_with_timeout_and_truncated_tcp_fallback: 15 : #&lt;TCPSocket:fd 15, AF_INET, 127.0.0.1, 61633&gt;
```
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
```
Leaked file descriptor: TestResolvDNS#test_multiple_servers_with_timeout_and_truncated_tcp_fallback: 15 : #&lt;TCPSocket:fd 15, AF_INET, 127.0.0.1, 61633&gt;
```
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/resolv] test_dns: Fix failure on Windows</title>
<updated>2024-08-13T23:13:10+00:00</updated>
<author>
<name>Sorah Fukumori</name>
<email>her@sorah.jp</email>
</author>
<published>2024-08-13T23:13:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=b20957bdfeaafcc6f842a3f427d1895b0325f62a'/>
<id>b20957bdfeaafcc6f842a3f427d1895b0325f62a</id>
<content type='text'>
(https://github.com/ruby/resolv/pull/58)

test_dns: Fix failure on Windows

1. Switch to #with_udp_and_tcp helper method for EACCES retries on Windows;
   the given UDP socket is unnecessary though.
2. Using 127.0.0.1 should be fine, as it must give different host:port pair.
3. On Windows, 5 retries of bind(2) appears still flaky, doubling it for sure.

follow-up: https://github.com/ruby/resolv/pull/50
follow-up: https://github.com/ruby/resolv/commit/6252914e95dfdf8995d8074df6cafe6f0a76c1ca

https://github.com/ruby/resolv/commit/0a0d57e369
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
(https://github.com/ruby/resolv/pull/58)

test_dns: Fix failure on Windows

1. Switch to #with_udp_and_tcp helper method for EACCES retries on Windows;
   the given UDP socket is unnecessary though.
2. Using 127.0.0.1 should be fine, as it must give different host:port pair.
3. On Windows, 5 retries of bind(2) appears still flaky, doubling it for sure.

follow-up: https://github.com/ruby/resolv/pull/50
follow-up: https://github.com/ruby/resolv/commit/6252914e95dfdf8995d8074df6cafe6f0a76c1ca

https://github.com/ruby/resolv/commit/0a0d57e369
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/resolv] Fix TCP fallback with multiple nameservers</title>
<updated>2024-08-13T21:09:08+00:00</updated>
<author>
<name>Igor Pstyga</name>
<email>igor.pstyga@gmail.com</email>
</author>
<published>2024-04-24T04:04:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=4be9b72fbb44e7754337f4957f2c7bfe3cd41891'/>
<id>4be9b72fbb44e7754337f4957f2c7bfe3cd41891</id>
<content type='text'>
Under the following conditions the exception
`Resolv::DNS::Requester::RequestError: host/port don't match` is raised:
- Multiple nameservers are configured for Resolv::DNS
- A nameserver falls back from UDP to TCP
- TCP request hits Resolv::DNS timeout
- Resolv::DNS retries the next nameserver

More details here https://bugs.ruby-lang.org/issues/8285

https://github.com/ruby/resolv/commit/7d524df80e

Co-authored-by: Julian Mehnle &lt;julian@mehnle.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Under the following conditions the exception
`Resolv::DNS::Requester::RequestError: host/port don't match` is raised:
- Multiple nameservers are configured for Resolv::DNS
- A nameserver falls back from UDP to TCP
- TCP request hits Resolv::DNS timeout
- Resolv::DNS retries the next nameserver

More details here https://bugs.ruby-lang.org/issues/8285

https://github.com/ruby/resolv/commit/7d524df80e

Co-authored-by: Julian Mehnle &lt;julian@mehnle.net&gt;
</pre>
</div>
</content>
</entry>
</feed>
