mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-31 16:46:54 +00:00
Use Reset at first
This commit is contained in:
@@ -33,11 +33,13 @@ func TestRecordOperation(t *testing.T) {
|
||||
// Use local registry
|
||||
var registry = compbasemetrics.NewKubeRegistry()
|
||||
var gather compbasemetrics.Gatherer = registry
|
||||
defer registry.Reset()
|
||||
|
||||
registry.MustRegister(metrics.RuntimeOperations)
|
||||
registry.MustRegister(metrics.RuntimeOperationsDuration)
|
||||
registry.MustRegister(metrics.RuntimeOperationsErrors)
|
||||
|
||||
registry.Reset()
|
||||
|
||||
l, err := net.Listen("tcp", "127.0.0.1:0")
|
||||
assert.NoError(t, err)
|
||||
defer l.Close()
|
||||
|
@@ -587,8 +587,6 @@ func TestGetHistogramVecFromGatherer(t *testing.T) {
|
||||
if diff := cmp.Diff(tt.wantVec, histogramVec); diff != "" {
|
||||
t.Errorf("Got unexpected HistogramVec (-want +got):\n%s", diff)
|
||||
}
|
||||
|
||||
registry.Reset()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user