From e0c6da8e2a4970f5648a56a369424ff610fbd0c5 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Fri, 10 Apr 2020 17:28:29 +0300 Subject: [PATCH] lib/storage: disable deduplication after dedup tests are complete The rest of tests expect that the de-duplication is disabled. --- lib/storage/dedup_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) 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)