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

net/http: TestTransportEventTraceRealDNS fails consistently #17670

Closed
odeke-em opened this issue Oct 30, 2016 · 5 comments

Comments

Projects
None yet
4 participants
@odeke-em
Copy link
Member

commented Oct 30, 2016

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go version devel +5552d08 Sat Oct 29 18:36:48 2016 +0000 darwin/amd64
tip at 5552d08

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN="/Users/emmanuelodeke/go/bin"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/emmanuelodeke/go"
GORACE=""
GOROOT="/Users/emmanuelodeke/go/src/go.googlesource.com/go"
GOTOOLDIR="/Users/emmanuelodeke/go/src/go.googlesource.com/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/v3/7z434qpx5v3bw0wh8h2myfpw0000gn/T/go-build205502808=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"

What did you do?

If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.

$ cd net/http
$ for i in $(seq 1 10);do echo "Trial $i at $(date)" >> log;go test -run=TestTransportEventTraceRealDNS 2>&1 >> log;echo -e "\n" >> log;done

What did you expect to see?

All pass or a flake in the worst case.

What did you see instead?

Trial 1 at Sat 29 Oct 2016 18:41:15 PDT
--- FAIL: TestTransportEventTraceRealDNS (0.53s)
    transport_test.go:3385: expected error during DNS lookup
FAIL
FAIL    net/http    0.545s


Trial 2 at Sat 29 Oct 2016 18:41:19 PDT
--- FAIL: TestTransportEventTraceRealDNS (0.08s)
    transport_test.go:3385: expected error during DNS lookup
FAIL
FAIL    net/http    0.090s


Trial 3 at Sat 29 Oct 2016 18:41:22 PDT
--- FAIL: TestTransportEventTraceRealDNS (0.07s)
    transport_test.go:3385: expected error during DNS lookup
FAIL
FAIL    net/http    0.082s


Trial 4 at Sat 29 Oct 2016 18:41:26 PDT
--- FAIL: TestTransportEventTraceRealDNS (0.51s)
    transport_test.go:3385: expected error during DNS lookup
FAIL
FAIL    net/http    0.523s


Trial 5 at Sat 29 Oct 2016 18:41:31 PDT
--- FAIL: TestTransportEventTraceRealDNS (0.07s)
    transport_test.go:3385: expected error during DNS lookup
FAIL
FAIL    net/http    0.081s


Trial 6 at Sat 29 Oct 2016 18:41:36 PDT
--- FAIL: TestTransportEventTraceRealDNS (0.10s)
    transport_test.go:3385: expected error during DNS lookup
FAIL
FAIL    net/http    0.108s


Trial 7 at Sat 29 Oct 2016 18:41:40 PDT
--- FAIL: TestTransportEventTraceRealDNS (2.26s)
    transport_test.go:3385: expected error during DNS lookup
FAIL
FAIL    net/http    2.271s


Trial 8 at Sat 29 Oct 2016 18:41:46 PDT
--- FAIL: TestTransportEventTraceRealDNS (0.08s)
    transport_test.go:3385: expected error during DNS lookup
FAIL
FAIL    net/http    0.090s


Trial 9 at Sat 29 Oct 2016 18:41:49 PDT
--- FAIL: TestTransportEventTraceRealDNS (0.09s)
    transport_test.go:3385: expected error during DNS lookup
FAIL
FAIL    net/http    0.105s


Trial 10 at Sat 29 Oct 2016 18:41:53 PDT
--- FAIL: TestTransportEventTraceRealDNS (1.44s)
    transport_test.go:3385: expected error during DNS lookup
FAIL
FAIL    net/http    1.449s


Is there something I change? I also tried running the test with CGO_ENABLED=0 go test -run=TestTransportEventTraceRealDNS but same results.

@odeke-em

This comment has been minimized.

Copy link
Member Author

commented Oct 30, 2016

/cc @bradfitz

@odeke-em

This comment has been minimized.

Copy link
Member Author

commented Oct 30, 2016

Perhaps this is a subset of #17472?

@bradfitz

This comment has been minimized.

Copy link
Member

commented Oct 30, 2016

This test is testing "real DNS" and you don't have real DNS.

Change your DNS to 8.8.8.8 or another standards-conformant DNS provider and it'll pass.

Or run with -short (as run with all.bash) and it'll skip that.

@bradfitz bradfitz closed this Oct 30, 2016

@odeke-em

This comment has been minimized.

Copy link
Member Author

commented Oct 30, 2016

Ahh, gotcha! Thanks

@hartzell

This comment has been minimized.

Copy link

commented Nov 18, 2016

I just tripped over a funny version of the problem.

I have a Digital Ocean droplet running an image based on their CentOS 7 image.

That machine was named foobar.dev.

/etc/resolv.conf contains only:

nameserver 8.8.8.8
nameserver 8.8.4.4

and /etc/nsswitch.conf contains (amongst others):

hosts:      files dns myhostname

For some reason, when it was unable to resolve dns-should-not-resolve.golang it tried dns-should-not-resolve.golang.dev (dig and host didn't have this problem, but ping does; I didn't track down why it was being so "helpful").

Things in .dev now resolve to 127.0.53.53, leading to the test failing.

My "fix" was to just rename the machine.

@golang golang locked and limited conversation to collaborators Nov 18, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.