From 6a4a87271b773bc8188e7f9a8416343a0467e761 Mon Sep 17 00:00:00 2001 From: Arve Knudsen Date: Tue, 24 Oct 2023 16:56:52 +0200 Subject: [PATCH] PostingsForMatchersCache test improvements Signed-off-by: Arve Knudsen --- tsdb/postings_for_matchers_cache_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tsdb/postings_for_matchers_cache_test.go b/tsdb/postings_for_matchers_cache_test.go index 41ccaacd47..c36a0f3593 100644 --- a/tsdb/postings_for_matchers_cache_test.go +++ b/tsdb/postings_for_matchers_cache_test.go @@ -44,7 +44,7 @@ func TestPostingsForMatchersCache(t *testing.T) { p, err := c.PostingsForMatchers(ctx, indexForPostingsMock{}, concurrent, expectedMatchers...) require.NoError(t, err) require.NotNil(t, p) - require.Equal(t, p.Err(), expectedPostingsErr, "Expected ErrPostings with err %q, got %T with err %q", expectedPostingsErr, p, p.Err()) + require.Equal(t, expectedPostingsErr, p.Err(), "Expected ErrPostings with err %q, got %T with err %q", expectedPostingsErr, p, p.Err()) }) } }) @@ -93,7 +93,7 @@ func TestPostingsForMatchersCache(t *testing.T) { expectedResults[i] = c[0].String() } - expectedPostingsForMatchersCalls := 5 + const expectedPostingsForMatchersCalls = 5 // we'll block all the calls until we receive the exact amount. if we receive more, WaitGroup will panic called := make(chan struct{}, expectedPostingsForMatchersCalls) release := make(chan struct{}) @@ -327,7 +327,7 @@ func TestPostingsForMatchersCache(t *testing.T) { require.Equal(t, refsLists[matchersKey(matchers)], actual) } - // To ensure the 1st (oldest) entry was removed, we call PostingsForMatchers() again on that matchers. + // To ensure the 1st (oldest) entry was removed, we call PostingsForMatchers() again on those matchers. _, err := c.PostingsForMatchers(ctx, indexForPostingsMock{}, true, matchersLists[0]...) require.NoError(t, err)