diff --git a/internal/component/prometheus/pipeline_test.go b/internal/component/prometheus/pipeline_test.go index 92f82bd56ab..756e3aaeaa2 100644 --- a/internal/component/prometheus/pipeline_test.go +++ b/internal/component/prometheus/pipeline_test.go @@ -207,6 +207,11 @@ func newRemoteWriteComponent(t testing.TB, logger log.Logger, ls *labelstore.Ser inMemoryAppendable := testappender.ConstantAppendable{Inner: testappender.NewCollectingAppender()} store := storage.NewFanout(fanoutLogger, walStorage, testStorage{inMemoryAppendable: inMemoryAppendable}) + t.Cleanup(func() { + store.Close() + walStorage.Close() + }) + return remotewrite.NewInterceptor("prometheus.remote_write.test", &atomic.Bool{}, livedebugging.NewLiveDebugging(), ls, store), inMemoryAppendable.Inner }