mirror of
https://github.com/prometheus/prometheus
synced 2024-12-27 00:53:12 +00:00
tsdb/wlog: add test for metrics unregistering
Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@vinted.com>
This commit is contained in:
parent
3b8fe00767
commit
bdf490726a
@ -23,6 +23,8 @@ import (
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"github.com/go-kit/log"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
client_testutil "github.com/prometheus/client_golang/prometheus/testutil"
|
||||
"github.com/stretchr/testify/require"
|
||||
"go.uber.org/goleak"
|
||||
@ -561,3 +563,13 @@ func BenchmarkWAL_Log(b *testing.B) {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestUnregisterMetrics(t *testing.T) {
|
||||
reg := prometheus.NewRegistry()
|
||||
|
||||
for i := 0; i < 2; i++ {
|
||||
wl, err := New(log.NewNopLogger(), reg, t.TempDir(), CompressionNone)
|
||||
require.NoError(t, err)
|
||||
require.NoError(t, wl.Close())
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user