1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

test/socket/test_addrinfo.rb: Suppress Errno::EACCES when addr is in use

MinGW seems to raise Errno::EACCES instead of EADDRINUSE when bind fails
due to in use.

https://github.com/ruby/ruby/runs/736825846
```
  2) Error:
TestSocketAddrinfo#test_connect_from:
Errno::EACCES: Permission denied - bind(2) for 0.0.0.0:49721
    D:/a/ruby/ruby/build/.ext/common/socket.rb:54:in `bind'
    D:/a/ruby/ruby/build/.ext/common/socket.rb:54:in `connect_internal'
    D:/a/ruby/ruby/build/.ext/common/socket.rb:114:in `connect_from'
    D:/a/ruby/ruby/src/test/socket/test_addrinfo.rb:379:in `block in test_connect_from'
    D:/a/ruby/ruby/src/test/socket/test_addrinfo.rb:374:in `open'
    D:/a/ruby/ruby/src/test/socket/test_addrinfo.rb:374:in `test_connect_from'
```
This commit is contained in:
Yusuke Endoh 2020-06-04 11:22:12 +09:00
parent 923e02a6a1
commit 980655ce83

View file

@ -367,7 +367,10 @@ class TestSocketAddrinfo < Test::Unit::TestCase
end end
def errors_addrinuse def errors_addrinuse
[Errno::EADDRINUSE] errs = [Errno::EADDRINUSE]
# MinGW fails with "Errno::EACCES: Permission denied - bind(2) for 0.0.0.0:49721"
errs << Errno::EACCES if if /mingw/ =~ RUBY_PLATFORM
errs
end end
def test_connect_from def test_connect_from