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:
parent
923e02a6a1
commit
980655ce83
1 changed files with 4 additions and 1 deletions
|
@ -367,7 +367,10 @@ class TestSocketAddrinfo < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
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
|
||||
|
||||
def test_connect_from
|
||||
|
|
Loading…
Reference in a new issue