net: dnsclient_unix_test.go will fail on a machine with 'test' in /etc/hosts and 'files' first in nsswitch.conf #19592
Comments
Out of curiosity, why do you have a |
I originally encountered this issue on a (FreeBSD) machine run by another group here at the university. Their habit is to have a full I tested this on my Linux machine with an artificial |
@siebenmann Can you confirm whether the fix in https://go-review.googlesource.com/c/38300/ works for you? |
CL https://golang.org/cl/38300 mentions this issue. |
@mdempsky I hand-applied the change to my source and this appears to completely fix the issue; I get no build failure here on the FreeBSD server with the original problem. |
What version of Go are you using (
go version
)?This issue reproduces when building the current git tip version of go, b9f6b22. Because it blocks finishing the build, I cannot show you literal 'go version' output on the affected machine. Testing says that this was introduced in commit bfc164c, 'net: add Resolver.StrictErrors', intended to fix issue #17448.
What operating system and processor architecture are you using (
go env
)?This also reproduces on FreeBSD.
What did you do?
Configure a machine with an /etc/hosts entry for the name
test
, such as:Then set
/etc/nsswitch.conf
to havehosts: files dns
, so that/etc/hosts
is checked before DNS. Then attempt to build go from source.What did you expect to see?
Build succeeds.
What did you see instead?
The build fails in
dnsclient_unix_test.go
where a whole bunch of DNS tests expect to get various errors or results when looking up the name 'test' but instead get thetest
entry from/etc/hosts
.The text was updated successfully, but these errors were encountered: