Skip to content

Commit

Permalink
fix test2
Browse files Browse the repository at this point in the history
Signed-off-by: SungJin1212 <[email protected]>
  • Loading branch information
SungJin1212 committed Feb 5, 2025
1 parent 9f6f9b0 commit 5096928
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pkg/block/indexheader/header_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ func TestReaders(t *testing.T) {
func compareIndexToHeader(t *testing.T, indexByteSlice index.ByteSlice, headerReader Reader) {
ctx := context.Background()

indexReader, err := index.NewReader(indexByteSlice)
indexReader, err := index.NewReader(indexByteSlice, index.DecodePostingsRaw)
testutil.Ok(t, err)
defer func() { _ = indexReader.Close() }()

Expand Down
9 changes: 7 additions & 2 deletions pkg/compact/downsample/downsample_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1160,7 +1160,7 @@ func TestDownsample(t *testing.T) {
_, err = metadata.ReadFromDir(filepath.Join(dir, id.String()))
testutil.Ok(t, err)

indexr, err := index.NewFileReader(filepath.Join(dir, id.String(), block.IndexFilename))
indexr, err := index.NewFileReader(filepath.Join(dir, id.String(), block.IndexFilename), index.DecodePostingsRaw)
testutil.Ok(t, err)
defer func() { testutil.Ok(t, indexr.Close()) }()

Expand Down Expand Up @@ -1289,7 +1289,7 @@ func TestDownsampleAggrAndNonEmptyXORChunks(t *testing.T) {
_, err = metadata.ReadFromDir(filepath.Join(dir, id.String()))
testutil.Ok(t, err)

indexr, err := index.NewFileReader(filepath.Join(dir, id.String(), block.IndexFilename))
indexr, err := index.NewFileReader(filepath.Join(dir, id.String(), block.IndexFilename), index.DecodePostingsRaw)
testutil.Ok(t, err)
defer func() { testutil.Ok(t, indexr.Close()) }()

Expand Down Expand Up @@ -1699,6 +1699,11 @@ func (s testSample) Type() chunkenc.ValueType {
panic("not implemented")
}

func (s testSample) Copy() chunks.Sample {
c := testSample{t: s.t, f: s.f}
return c
}

type sampleIterator struct {
l []sample
i int
Expand Down
9 changes: 5 additions & 4 deletions pkg/query/querier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
"github.com/prometheus/prometheus/tsdb/chunkenc"
"github.com/prometheus/prometheus/util/annotations"
"github.com/prometheus/prometheus/util/gate"
"github.com/thanos-io/thanos/pkg/logutil"

"github.com/thanos-io/thanos/pkg/component"
"github.com/thanos-io/thanos/pkg/store"
Expand Down Expand Up @@ -378,7 +379,7 @@ func TestQuerier_Select_AfterPromQL(t *testing.T) {
t.Run(tcase.name, func(t *testing.T) {
timeout := 5 * time.Minute
e := promql.NewEngine(promql.EngineOpts{
Logger: logger,
Logger: logutil.GoKitLogToSlog(logger),
Timeout: timeout,
MaxSamples: math.MaxInt64,
LookbackDelta: tcase.lookbackDelta,
Expand Down Expand Up @@ -765,7 +766,7 @@ func TestQuerier_Select(t *testing.T) {
} {
timeout := 5 * time.Second
e := promql.NewEngine(promql.EngineOpts{
Logger: logger,
Logger: logutil.GoKitLogToSlog(logger),
Timeout: timeout,
MaxSamples: math.MaxInt64,
})
Expand Down Expand Up @@ -1091,7 +1092,7 @@ func TestQuerierWithDedupUnderstoodByPromQL_Rate(t *testing.T) {
})

e := promql.NewEngine(promql.EngineOpts{
Logger: logger,
Logger: logutil.GoKitLogToSlog(logger),
Timeout: timeout,
MaxSamples: math.MaxInt64,
})
Expand Down Expand Up @@ -1161,7 +1162,7 @@ func TestQuerierWithDedupUnderstoodByPromQL_Rate(t *testing.T) {
})

e := promql.NewEngine(promql.EngineOpts{
Logger: logger,
Logger: logutil.GoKitLogToSlog(logger),
Timeout: timeout,
MaxSamples: math.MaxInt64,
})
Expand Down

0 comments on commit 5096928

Please sign in to comment.