From 3dd18a1ece60f9dc77a41b1111a45226796a6650 Mon Sep 17 00:00:00 2001 From: Oleg Zaytsev Date: Mon, 11 Oct 2021 15:15:56 +0200 Subject: [PATCH] Test that approxBytesPerEntry const is correct The comment on the constant mentions where it comes from, so we can actually check its value in that test. Signed-off-by: Oleg Zaytsev --- tsdb/hashcache/series_hash_cache_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/tsdb/hashcache/series_hash_cache_test.go b/tsdb/hashcache/series_hash_cache_test.go index e04c35387..9e0c6cf21 100644 --- a/tsdb/hashcache/series_hash_cache_test.go +++ b/tsdb/hashcache/series_hash_cache_test.go @@ -64,6 +64,7 @@ func TestSeriesHashCache_MeasureApproximateSizePerEntry(t *testing.T) { runtime.ReadMemStats(&after) t.Logf("approximate size per entry: %d bytes", (after.TotalAlloc-before.TotalAlloc)/numEntries) + require.Equal(t, uint64(approxBytesPerEntry), (after.TotalAlloc-before.TotalAlloc)/numEntries, "approxBytesPerEntry constant is out date") } func TestSeriesHashCache_Concurrency(t *testing.T) {