diff --git a/command/util_test.go b/command/util_test.go index 5c4b60c06..26d963a3b 100644 --- a/command/util_test.go +++ b/command/util_test.go @@ -4,7 +4,6 @@ import ( "fmt" "io/ioutil" "math/rand" - "net" "os" "strings" "sync/atomic" @@ -35,7 +34,6 @@ type agentWrapper struct { config *agent.Config agent *agent.Agent http *agent.HTTPServer - addr string httpAddr string } @@ -63,13 +61,7 @@ func testAgentWithConfig(t *testing.T, cb func(c *agent.Config)) *agentWrapper { } func testAgentWithConfigReload(t *testing.T, cb func(c *agent.Config), reloadCh chan chan error) *agentWrapper { - l, err := net.Listen("tcp", "127.0.0.1:0") - if err != nil { - t.Fatalf("err: %s", err) - } - lw := logger.NewLogWriter(512) - conf := nextConfig() if cb != nil { cb(conf) @@ -105,7 +97,6 @@ func testAgentWithConfigReload(t *testing.T, cb func(c *agent.Config), reloadCh config: conf, agent: a, http: http[0], - addr: l.Addr().String(), httpAddr: httpAddr, } }