-
Notifications
You must be signed in to change notification settings - Fork 18k
x/net/proxy: TestDial persistently failing on js-wasm builder #32842
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
Comments
I think they should be skipped. Dial tests are not supported in js. As is evident from the build tag in |
@agnivade wrote:
thanks for this pointer, i will submit a fix |
So I found Line 5 in ef9217e
TestDial() is only failing with Direct* passes that actually attempt a connection to localhost via IP. The internal/socks stuff should fail as well but it is using nettest#NewLocalListener .
|
My guess is that is because // TargetAddr returns a fake final destination address.
//
// The returned address is only valid for testing with Server.
func (s *Server) TargetAddr() net.Addr {
a := s.ln.Addr()
switch a := a.(type) {
case *net.TCPAddr:
if a.IP.To4() != nil {
return &net.TCPAddr{IP: net.IPv4(127, 0, 0, 1), Port: 5963}
}
if a.IP.To16() != nil && a.IP.To4() == nil {
return &net.TCPAddr{IP: net.IPv6loopback, Port: 5963}
}
}
return nil
} You will see in the tests that the port returned is always In general, func main() {
l, err := net.Listen("tcp4", "127.0.0.1:0")
if err != nil {
panic(err)
}
defer l.Close()
fmt.Println(l.Addr().String())
} gives - So anything that dials at a listener listening at |
Turns out that not fully honoring the listener address, aka knowing it is a "local" address and so providing an empty string for the host portion of the address to |
Change https://golang.org/cl/184178 mentions this issue: |
|
The test for
golang.org/x/net/proxy
is persistently failing on thejs-wasm
builder.If it is not expected to pass, it should be skipped to avoid masking more serious bugs.
https://build.golang.org/log/c1cfc25dcb267d98777f1b08f6f3842f329d4fa1:
The text was updated successfully, but these errors were encountered: