diff --git a/agent/agent_endpoint_test.go b/agent/agent_endpoint_test.go index fbb418bdea..3426b3bac1 100644 --- a/agent/agent_endpoint_test.go +++ b/agent/agent_endpoint_test.go @@ -243,14 +243,14 @@ func TestAgent_Metrics_ACLDeny(t *testing.T) { t.Run("no token", func(t *testing.T) { req, _ := http.NewRequest("GET", "/v1/agent/metrics", nil) - if _, err := a.srv.AgentSelf(nil, req); !acl.IsErrPermissionDenied(err) { + if _, err := a.srv.AgentMetrics(nil, req); !acl.IsErrPermissionDenied(err) { t.Fatalf("err: %v", err) } }) t.Run("agent master token", func(t *testing.T) { req, _ := http.NewRequest("GET", "/v1/agent/metrics?token=towel", nil) - if _, err := a.srv.AgentSelf(nil, req); err != nil { + if _, err := a.srv.AgentMetrics(nil, req); err != nil { t.Fatalf("err: %v", err) } }) @@ -258,7 +258,7 @@ func TestAgent_Metrics_ACLDeny(t *testing.T) { t.Run("read-only token", func(t *testing.T) { ro := makeReadOnlyAgentACL(t, a.srv) req, _ := http.NewRequest("GET", fmt.Sprintf("/v1/agent/metrics?token=%s", ro), nil) - if _, err := a.srv.AgentSelf(nil, req); err != nil { + if _, err := a.srv.AgentMetrics(nil, req); err != nil { t.Fatalf("err: %v", err) } }) diff --git a/agent/testagent.go b/agent/testagent.go index 788d90571c..bf3d12beb0 100644 --- a/agent/testagent.go +++ b/agent/testagent.go @@ -144,7 +144,7 @@ func (a *TestAgent) Start() *TestAgent { agent.LogOutput = logOutput agent.LogWriter = a.LogWriter agent.logger = log.New(logOutput, a.Name+" - ", log.LstdFlags|log.Lmicroseconds) - agent.MemSink = &metrics.InmemSink{} + agent.MemSink = metrics.NewInmemSink(1*time.Second, time.Minute) // we need the err var in the next exit condition if err := agent.Start(); err == nil {