Skip to content

x/net/{ipv4,ipv6}: multicastlistener_test.go assumes a specific port is available #20558

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

Closed
bcmills opened this issue Jun 2, 2017 · 3 comments

Comments

@bcmills
Copy link
Contributor

bcmills commented Jun 2, 2017

There are two tests in this file that assume that IPv6 port 1024 is available:

https://github.com/golang/net/blob/master/ipv6/multicastlistener_test.go#L73:

c1, err := net.ListenPacket("udp6", "[ff02::]:1024") // wildcard address with reusable port
if err != nil {
	t.Fatal(err)
}
defer c1.Close()

c2, err := net.ListenPacket("udp6", "[ff02::]:1024") // wildcard address with reusable port
if err != nil {
	t.Fatal(err)
}
defer c2.Close()

https://github.com/golang/net/blob/master/ipv6/multicastlistener_test.go#L140

c, err := net.ListenPacket("udp6", fmt.Sprintf("[%s%%%s]:1024", ip.String(), ifi.Name)) // unicast address with non-reusable port
if err != nil {
	t.Fatal(err)
}

That makes the test excessively fragile when run on a machine that may have open IPv6 connections.

@gopherbot gopherbot added this to the Unreleased milestone Jun 2, 2017
@ianlancetaylor
Copy link
Contributor

CC @mikioh

@gopherbot
Copy link
Contributor

CL https://golang.org/cl/44770 mentions this issue.

@gopherbot
Copy link
Contributor

CL https://golang.org/cl/44775 mentions this issue.

@mikioh mikioh changed the title x/net/ipv6: multicastlistener_test.go assumes a specific port is available x/net/{ipv4,ipv6]: multicastlistener_test.go assumes a specific port is available Jun 4, 2017
@mikioh mikioh changed the title x/net/{ipv4,ipv6]: multicastlistener_test.go assumes a specific port is available x/net/{ipv4,ipv6}: multicastlistener_test.go assumes a specific port is available Jun 4, 2017
gopherbot pushed a commit to golang/net that referenced this issue Jun 5, 2017
Fixes golang/go#20558.

Change-Id: I8813d1eadd40680bd8619bb9a6539a3c45dcd76e
Reviewed-on: https://go-review.googlesource.com/44770
Run-TryBot: Mikio Hara <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
Reviewed-by: Ian Lance Taylor <[email protected]>
@golang golang locked and limited conversation to collaborators Jun 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants