Skip to content

Commit

Permalink
Improve bloomshipper cache test
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
  • Loading branch information
chaudum committed Sep 20, 2024
1 parent 664536a commit b591293
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/storage/stores/shipper/bloomshipper/cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
"github.com/go-kit/log"
"github.com/stretchr/testify/require"

"github.com/grafana/loki/v3/pkg/compression"
"github.com/grafana/loki/v3/pkg/logqlmodel/stats"
v1 "github.com/grafana/loki/v3/pkg/storage/bloom/v1"
"github.com/grafana/loki/v3/pkg/storage/stores/shipper/bloomshipper/config"
)

Expand Down Expand Up @@ -64,7 +64,8 @@ func Test_LoadBlocksDirIntoCache(t *testing.T) {
wd := t.TempDir()

// plain file
fp, _ := os.Create(filepath.Join(wd, "regular-file.tar"))
ext := blockExtension + compression.ExtGZIP
fp, _ := os.Create(filepath.Join(wd, "regular-file"+ext))
fp.Close()

// invalid directory
Expand Down Expand Up @@ -100,7 +101,7 @@ func Test_LoadBlocksDirIntoCache(t *testing.T) {

require.Equal(t, 1, len(c.entries))

key := validDir + v1.ExtTar // cache key must not contain directory prefix
key := validDir + ext // cache key must not contain directory prefix
elem, found := c.entries[key]
require.True(t, found)
blockDir := elem.Value.(*Entry).Value
Expand Down

0 comments on commit b591293

Please sign in to comment.