lib/storage: disable deduplication after dedup tests are complete

The rest of tests expect that the de-duplication is disabled.
This commit is contained in:
Aliaksandr Valialkin 2020-04-10 17:28:29 +03:00
parent 8ed0d5471a
commit e0c6da8e2a

View file

@ -7,6 +7,9 @@ import (
) )
func TestGetMinDelta(t *testing.T) { 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) { f := func(scrapeInterval time.Duration, dExpected int64) {
t.Helper() t.Helper()
SetMinScrapeIntervalForDeduplication(scrapeInterval) SetMinScrapeIntervalForDeduplication(scrapeInterval)
@ -25,6 +28,9 @@ func TestGetMinDelta(t *testing.T) {
} }
func TestDeduplicateSamples(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) { f := func(scrapeInterval time.Duration, timestamps, timestampsExpected []int64) {
t.Helper() t.Helper()
SetMinScrapeIntervalForDeduplication(scrapeInterval) SetMinScrapeIntervalForDeduplication(scrapeInterval)
@ -72,6 +78,9 @@ func TestDeduplicateSamples(t *testing.T) {
} }
func TestDeduplicateSamplesDuringMerge(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) { f := func(scrapeInterval time.Duration, timestamps, timestampsExpected []int64) {
t.Helper() t.Helper()
SetMinScrapeIntervalForDeduplication(scrapeInterval) SetMinScrapeIntervalForDeduplication(scrapeInterval)