Skip to content

Commit

Permalink
Omit Windows and MinGW platforms with with_udp_and_tcp
Browse files Browse the repository at this point in the history
https://github.com/ruby/resolv/actions/runs/12021339854/job/33511655994?pr=64

```
  => 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'
```
  • Loading branch information
hsbt committed Nov 26, 2024
1 parent e906978 commit e4b40d2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/resolv/test_dns.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ def with_udp_and_tcp(host, port)
# See: https://stackoverflow.com/questions/48478869/cannot-bind-to-some-ports-due-to-permission-denied
retries_remaining -= 1
retry if retries_remaining > 0
# Windows and MinGW CI can't bind to the same port with ten retries.
omit if /mswin|mingw/ =~ RUBY_PLATFORM
raise
end

Expand Down

0 comments on commit e4b40d2

Please sign in to comment.