The Mac is picky about the syntax for listening on ephemeral ports.

pull/6/head
Joe Beda 2014-06-13 16:04:17 -07:00
parent 2324dc1510
commit 239e1273cf
2 changed files with 2 additions and 2 deletions

View File

@ -102,7 +102,7 @@ func (proxier Proxier) AddService(service string, port int) error {
// For testing on a system with unknown ports used.
func (proxier Proxier) addServiceOnUnusedPort(service string) (string, error) {
// Make sure we can start listening on the port before saying all's well.
l, err := net.Listen("tcp", ":")
l, err := net.Listen("tcp", ":0")
if err != nil {
return "", err
}

View File

@ -46,7 +46,7 @@ func echoServer(t *testing.T, addr string) (string, error) {
}
func TestProxy(t *testing.T) {
port, err := echoServer(t, "127.0.0.1:")
port, err := echoServer(t, "127.0.0.1:0")
if err != nil {
t.Fatal(err)
}