From ec795849ea082b6c71fb81ffb7a532b9eba41b0b Mon Sep 17 00:00:00 2001 From: James Phillips Date: Mon, 6 Nov 2017 21:43:39 -0800 Subject: [PATCH] Fetches metrics in the retry loop so there's some hope. Fixes #3656 --- api/agent_test.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/api/agent_test.go b/api/agent_test.go index 7d97a3af7..3787b3642 100644 --- a/api/agent_test.go +++ b/api/agent_test.go @@ -37,13 +37,11 @@ func TestAPI_AgentMetrics(t *testing.T) { defer s.Stop() agent := c.Agent() - - metrics, err := agent.Metrics() - if err != nil { - t.Fatalf("err: %v", err) - } - retry.Run(t, func(r *retry.R) { + metrics, err := agent.Metrics() + if err != nil { + r.Fatalf("err: %v", err) + } for _, g := range metrics.Gauges { if g.Name == "consul.runtime.alloc_bytes" { return