Fetches metrics in the retry loop so there's some hope.

Fixes #3656
This commit is contained in:
James Phillips 2017-11-06 21:43:39 -08:00
parent b15d8db851
commit 172d5c0c40
No known key found for this signature in database
GPG Key ID: 77183E682AC5FC11
1 changed files with 4 additions and 6 deletions

View File

@ -37,13 +37,11 @@ func TestAPI_AgentMetrics(t *testing.T) {
defer s.Stop() defer s.Stop()
agent := c.Agent() agent := c.Agent()
metrics, err := agent.Metrics()
if err != nil {
t.Fatalf("err: %v", err)
}
retry.Run(t, func(r *retry.R) { retry.Run(t, func(r *retry.R) {
metrics, err := agent.Metrics()
if err != nil {
r.Fatalf("err: %v", err)
}
for _, g := range metrics.Gauges { for _, g := range metrics.Gauges {
if g.Name == "consul.runtime.alloc_bytes" { if g.Name == "consul.runtime.alloc_bytes" {
return return