From 416c578f7abc6cffcb9b2a8a9e12757a878fdc47 Mon Sep 17 00:00:00 2001 From: Chavez Date: Tue, 29 Mar 2016 12:09:23 -0700 Subject: [PATCH] Retry http server connecting in agent/http_test --- command/agent/http_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/command/agent/http_test.go b/command/agent/http_test.go index 1afabb0946..685f5cbd44 100644 --- a/command/agent/http_test.go +++ b/command/agent/http_test.go @@ -28,6 +28,9 @@ func makeHTTPServer(t *testing.T) (string, *HTTPServer) { } func makeHTTPServerWithConfig(t *testing.T, cb func(c *Config)) (string, *HTTPServer) { + configTry := 0 +RECONF: + configTry += 1 conf := nextConfig() if cb != nil { cb(conf) @@ -36,6 +39,9 @@ func makeHTTPServerWithConfig(t *testing.T, cb func(c *Config)) (string, *HTTPSe dir, agent := makeAgent(t, conf) servers, err := NewHTTPServers(agent, conf, agent.logOutput) if err != nil { + if configTry < 3 { + goto RECONF + } t.Fatalf("err: %v", err) } if len(servers) == 0 {