Changed approxBytesPerEntry after upgrading to golang 1.21

Signed-off-by: Marco Pracucci <marco@pracucci.com>
This commit is contained in:
Marco Pracucci 2024-01-05 13:17:18 +01:00
parent 7c8e9a2a76
commit 397179e394
No known key found for this signature in database
GPG key ID: 74C1BD403D2DF9B5
2 changed files with 2 additions and 2 deletions

View file

@ -13,7 +13,7 @@ const (
// approxBytesPerEntry is the estimated memory footprint (in bytes) of 1 cache
// entry, measured with TestSeriesHashCache_MeasureApproximateSizePerEntry().
approxBytesPerEntry = 28
approxBytesPerEntry = 50
)
// SeriesHashCache is a bounded cache mapping the per-block series ID with

View file

@ -66,7 +66,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")
require.Equal(t, approxBytesPerEntry, int((after.TotalAlloc-before.TotalAlloc)/numEntries), "approxBytesPerEntry constant is out date")
}
func TestSeriesHashCache_Concurrency(t *testing.T) {