mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Use defer in non-loop
This commit is contained in:
parent
a30af261f1
commit
49d341aa2b
@ -33,6 +33,7 @@ import (
|
||||
func TestRecordOperation(t *testing.T) {
|
||||
// Use local registry
|
||||
var registry = compbasemetrics.NewKubeRegistry()
|
||||
defer registry.Reset()
|
||||
registry.MustRegister(metrics.RuntimeOperations)
|
||||
registry.MustRegister(metrics.RuntimeOperationsDuration)
|
||||
registry.MustRegister(metrics.RuntimeOperationsErrors)
|
||||
@ -64,8 +65,6 @@ func TestRecordOperation(t *testing.T) {
|
||||
assert.HTTPBodyContains(t, http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
mux.ServeHTTP(w, r)
|
||||
}), "GET", prometheusURL, nil, runtimeOperationsDurationExpected)
|
||||
|
||||
registry.Reset()
|
||||
}
|
||||
|
||||
func TestInstrumentedVersion(t *testing.T) {
|
||||
|
Loading…
Reference in New Issue
Block a user