diff --git a/lib/storage/dedup_test.go b/lib/storage/dedup_test.go index 8b9d8ecf7e..b33d5b5d0e 100644 --- a/lib/storage/dedup_test.go +++ b/lib/storage/dedup_test.go @@ -7,6 +7,9 @@ import ( ) func TestGetMinDelta(t *testing.T) { + // Disable deduplication before exit, since the rest of tests expect disabled dedup. + defer SetMinScrapeIntervalForDeduplication(0) + f := func(scrapeInterval time.Duration, dExpected int64) { t.Helper() SetMinScrapeIntervalForDeduplication(scrapeInterval) @@ -25,6 +28,9 @@ func TestGetMinDelta(t *testing.T) { } func TestDeduplicateSamples(t *testing.T) { + // Disable deduplication before exit, since the rest of tests expect disabled dedup. + defer SetMinScrapeIntervalForDeduplication(0) + f := func(scrapeInterval time.Duration, timestamps, timestampsExpected []int64) { t.Helper() SetMinScrapeIntervalForDeduplication(scrapeInterval) @@ -72,6 +78,9 @@ func TestDeduplicateSamples(t *testing.T) { } func TestDeduplicateSamplesDuringMerge(t *testing.T) { + // Disable deduplication before exit, since the rest of tests expect disabled dedup. + defer SetMinScrapeIntervalForDeduplication(0) + f := func(scrapeInterval time.Duration, timestamps, timestampsExpected []int64) { t.Helper() SetMinScrapeIntervalForDeduplication(scrapeInterval)