-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
TestServerCredsDispatch goes into a loop and never passes or fails #1058
Comments
Same issue over here... |
Also experienced this on 1.8.1, Centos 7.3. Happening one out of 4 or 5 times. |
I'm not able to reproduce this... I believe the issue behind this is mentioned at golang/go#18806, and it's OS-dependent. I'm closing this issue now. Please leave your comment here if you think there's some action we need to take. |
@menghanl, please reopen this. You're relying on undefined behavior. The Go bug is about defining it, but that would only help Go 1.9+. You need to fix it for earlier Go versions. The fix is easy: don't listen on ":nnn" and use ln.Addr().String(). |
Do you mean: don't listen on ":nnn" and don't use |
Yes, sorry: you can listen on ":nnn" but if you do so, you're not allowed to use So you need to clean it up, mapping "0.0.0.0" to "127.0.0.1". Instead of listening on ":nnn", I recommend using: func newLocalListener(t *testing.T) net.Listener {
ln, err := net.Listen("tcp", "127.0.0.1:0")
if err != nil {
ln, err = net.Listen("tcp6", "[::1]:0")
}
if err != nil {
t.Fatal(err)
}
return ln
} |
Thanks for the suggestion. We will have a fix for this. |
Fix in #1237, PTAL. One thing to note is that, I'm using "localhost:port", not "127.0.0.1:0" or "[::1]:0". |
In Go's experience, not all machines have "localhost" both defined and defined to be the correct loopback address. That's why all the Go unit tests use the |
With both Go 1.7 and Go 1.8 on my machine:
The text was updated successfully, but these errors were encountered: