Skip to content
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

Sockets tests no longer pass locally on macOS #31593

Closed
StefanKarpinski opened this issue Apr 3, 2019 · 9 comments
Closed

Sockets tests no longer pass locally on macOS #31593

StefanKarpinski opened this issue Apr 3, 2019 · 9 comments
Labels
io Involving the I/O subsystem: libuv, read, write, etc. test This change adds or pertains to unit tests

Comments

@StefanKarpinski
Copy link
Member

My system doesn't like the name localhost and throws errors:

Test Summary: | Pass  Error  Total
  Overall     |  104      3    107
    Sockets   |  104      3    107
    FAILURE

The global RNG seed was 0xaf3487891be1d66beabb01ffeafb39a6.

Error in testset Sockets:
Error During Test at /Users/stefan/dev/julia/usr/share/julia/stdlib/v1.2/Sockets/test/runtests.jl:177
  Test threw exception
  Expression: !(isempty(getalladdrinfo(localhost)::Vector{IPAddr}))
  DNSError: localhost, unknown node or service (EAI_NONAME)
  Stacktrace:
   [1] getalladdrinfo(::String) at /Users/stefan/dev/julia/usr/share/julia/stdlib/v1.2/Sockets/src/addrinfo.jl:97
   [2] top-level scope at /Users/stefan/dev/julia/usr/share/julia/stdlib/v1.2/Sockets/test/runtests.jl:177
   [3] top-level scope at /Users/stefan/dev/julia/usr/share/julia/stdlib/v1.2/Test/src/Test.jl:1113
   [4] top-level scope at /Users/stefan/dev/julia/usr/share/julia/stdlib/v1.2/Sockets/test/runtests.jl:175

Error in testset Sockets:
Error During Test at /Users/stefan/dev/julia/usr/share/julia/stdlib/v1.2/Sockets/test/runtests.jl:178
  Test threw exception
  Expression: getaddrinfo(localhost, IPv4)::IPv4 != #= /Users/stefan/dev/julia/usr/share/julia/stdlib/v1.2/Sockets/test/runtests.jl:178 =# @ip_str("0.0.0.0")
  DNSError: localhost, unknown node or service (EAI_NONAME)
  Stacktrace:
   [1] getalladdrinfo(::String) at /Users/stefan/dev/julia/usr/share/julia/stdlib/v1.2/Sockets/src/addrinfo.jl:97
   [2] getaddrinfo(::String, ::Type{IPv4}) at /Users/stefan/dev/julia/usr/share/julia/stdlib/v1.2/Sockets/src/addrinfo.jl:115
   [3] top-level scope at /Users/stefan/dev/julia/usr/share/julia/stdlib/v1.2/Sockets/test/runtests.jl:178
   [4] top-level scope at /Users/stefan/dev/julia/usr/share/julia/stdlib/v1.2/Test/src/Test.jl:1113
   [5] top-level scope at /Users/stefan/dev/julia/usr/share/julia/stdlib/v1.2/Sockets/test/runtests.jl:175

Error in testset Sockets:
Error During Test at /Users/stefan/dev/julia/test/testdefs.jl:20
  Got exception outside of a @test
  Error while loading expression starting at /Users/stefan/dev/julia/usr/share/julia/stdlib/v1.2/Sockets/test/runtests.jl:212
  caused by [exception 1]
  DNSError: localhost, unknown node or service (EAI_NONAME)
  Stacktrace:
   [1] getalladdrinfo(::String) at /Users/stefan/dev/julia/usr/share/julia/stdlib/v1.2/Sockets/src/addrinfo.jl:97
   [2] getaddrinfo at /Users/stefan/dev/julia/usr/share/julia/stdlib/v1.2/Sockets/src/addrinfo.jl:115 [inlined]
   [3] getaddrinfo(::String) at /Users/stefan/dev/julia/usr/share/julia/stdlib/v1.2/Sockets/src/addrinfo.jl:124
   [4] top-level scope at /Users/stefan/dev/julia/usr/share/julia/stdlib/v1.2/Sockets/test/runtests.jl:212
   [5] include at ./boot.jl:328 [inlined]
   [6] include_relative(::Module, ::String) at ./loading.jl:1042
   [7] include at ./Base.jl:31 [inlined]
   [8] include(::String) at /Users/stefan/dev/julia/test/testdefs.jl:13
   [9] top-level scope at /Users/stefan/dev/julia/test/testdefs.jl:23
   [10] top-level scope at /Users/stefan/dev/julia/usr/share/julia/stdlib/v1.2/Test/src/Test.jl:1113
   [11] top-level scope at /Users/stefan/dev/julia/test/testdefs.jl:22
   [12] top-level scope at util.jl:289
   [13] top-level scope at /Users/stefan/dev/julia/test/testdefs.jl:20
   [14] eval at ./boot.jl:330 [inlined]
   [15] #runtests#57(::UInt128, ::typeof(runtests), ::String, ::String, ::Bool) at /Users/stefan/dev/julia/test/testdefs.jl:26
   [16] #runtests at ./none:0 [inlined] (repeats 2 times)
   [17] #145 at /Users/stefan/dev/julia/usr/share/julia/stdlib/v1.2/Distributed/src/remotecall.jl:339 [inlined]
   [18] run_work_thunk(::getfield(Distributed, Symbol("##145#146")){typeof(runtests),Tuple{String,String},Base.Iterators.Pairs{Symbol,UInt128,Tuple{Symbol},NamedTuple{(:seed,),Tuple{UInt128}}}}, ::Bool) at /Users/stefan/dev/julia/usr/share/julia/stdlib/v1.2/Distributed/src/process_messages.jl:79
   [19] #remotecall_fetch#150(::Base.Iterators.Pairs{Symbol,UInt128,Tuple{Symbol},NamedTuple{(:seed,),Tuple{UInt128}}}, ::typeof(remotecall_fetch), ::Function, ::Distributed.LocalProcess, ::String, ::Vararg{String,N} where N) at /Users/stefan/dev/julia/usr/share/julia/stdlib/v1.2/Distributed/src/remotecall.jl:364
   [20] (::getfield(Distributed, Symbol("#kw##remotecall_fetch")))(::NamedTuple{(:seed,),Tuple{UInt128}}, ::typeof(remotecall_fetch), ::Function, ::Distributed.LocalProcess, ::String, ::Vararg{String,N} where N) at ./none:0
   [21] #remotecall_fetch#154(::Base.Iterators.Pairs{Symbol,UInt128,Tuple{Symbol},NamedTuple{(:seed,),Tuple{UInt128}}}, ::typeof(remotecall_fetch), ::Function, ::Int64, ::String, ::Vararg{String,N} where N) at /Users/stefan/dev/julia/usr/share/julia/stdlib/v1.2/Distributed/src/remotecall.jl:406
   [22] (::getfield(Distributed, Symbol("#kw##remotecall_fetch")))(::NamedTuple{(:seed,),Tuple{UInt128}}, ::typeof(remotecall_fetch), ::Function, ::Int64, ::String, ::Vararg{String,N} where N) at ./none:0
   [23] macro expansion at /Users/stefan/dev/julia/test/runtests.jl:145 [inlined]
   [24] (::getfield(Main, Symbol("##47#54")){Array{Any,1},getfield(Main, Symbol("#print_testworker_stats#52")){Int64,Int64,Int64,Int64,Int64,Int64,ReentrantLock},Array{Task,1}})() at ./task.jl:268

ERROR: Error while loading expression starting at /Users/stefan/dev/julia/test/runtests.jl:61
caused by [exception 1]
Test run finished with errors
@StefanKarpinski StefanKarpinski added io Involving the I/O subsystem: libuv, read, write, etc. test This change adds or pertains to unit tests labels Apr 3, 2019
@StefanKarpinski
Copy link
Member Author

Discovered when testing #30609 but not caused by it.

@jpsamaroo
Copy link
Member

Why are we checking that localhost != 0.0.0.0 here? 0.0.0.0 doesn't specify a subnet mask so the default would be 0.0.0.0/32, but I assume we want to test that it's not the same as 0.0.0.0/0.

@jpsamaroo
Copy link
Member

Also, would it be fair to normalize "localhost" to ip"127.0.0.1" if that will work everywhere?

@StefanKarpinski
Copy link
Member Author

I dunno. The next step would be to look into who added those tests and ask them why.

@vtjnash
Copy link
Member

vtjnash commented May 2, 2019

Did you manage to corrupt your /etc/hosts files?

@StefanKarpinski
Copy link
Member Author

It's empty if that's what you mean, but I didn't do anything to it.

@vtjnash
Copy link
Member

vtjnash commented May 2, 2019

Yes indeed. The default file starts with something like:

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1	localhost

Apparently new systemd installations now handle this internally and empty the file, but historically the file should look something like this.

@vtjnash vtjnash closed this as completed May 2, 2019
@ViralBShah
Copy link
Member

That's what my /etc/hosts looks like.

@StefanKarpinski
Copy link
Member Author

Weird, I guess it somehow got truncated at some point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
io Involving the I/O subsystem: libuv, read, write, etc. test This change adds or pertains to unit tests
Projects
None yet
Development

No branches or pull requests

4 participants