From e6b7c0efbd1340fab51b91c25fde844944f89494 Mon Sep 17 00:00:00 2001 From: alanprot Date: Fri, 22 Nov 2024 14:09:28 -0800 Subject: [PATCH] Creating Test Signed-off-by: alanprot --- pkg/ingester/ingester_test.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pkg/ingester/ingester_test.go b/pkg/ingester/ingester_test.go index 6f1f145a9ee..55d7d3e7ead 100644 --- a/pkg/ingester/ingester_test.go +++ b/pkg/ingester/ingester_test.go @@ -5085,12 +5085,16 @@ func TestExpendedPostingsCacheIsolation(t *testing.T) { cfg.BlocksStorageConfig.TSDB.BlockRanges = []time.Duration{2 * time.Hour} cfg.LifecyclerConfig.JoinAfter = 0 cfg.BlocksStorageConfig.TSDB.PostingsCache = cortex_tsdb.TSDBPostingsCacheConfig{ - SeedSize: 1, // lets make sure all metric names collide + SeedSize: 3, // lets make sure all metric names collide Head: cortex_tsdb.PostingsCacheConfig{ - Enabled: true, + Enabled: true, + Ttl: time.Hour, + MaxBytes: 1024 * 1024 * 1024, }, Blocks: cortex_tsdb.PostingsCacheConfig{ - Enabled: true, + Enabled: true, + Ttl: time.Hour, + MaxBytes: 1024 * 1024 * 1024, }, } @@ -5109,7 +5113,7 @@ func TestExpendedPostingsCacheIsolation(t *testing.T) { defer wg.Done() userId := fmt.Sprintf("user%v", j) ctx := user.InjectOrgID(context.Background(), userId) - _, err = i.Push(ctx, cortexpb.ToWriteRequest( + _, err := i.Push(ctx, cortexpb.ToWriteRequest( []labels.Labels{labels.FromStrings(labels.MetricName, "foo", "userId", userId)}, []cortexpb.Sample{{Value: 2, TimestampMs: 4 * 60 * 60 * 1000}}, nil, nil, cortexpb.API)) require.NoError(t, err) }()