Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Ye <benye@amazon.com>
  • Loading branch information
yeya24 committed May 16, 2024
1 parent 3705845 commit 168c081
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkg/store/bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,10 @@ func WithLogger(logger log.Logger) BucketStoreOption {

type RequestLoggerFunc func(ctx context.Context, log log.Logger) log.Logger

func NoopRequestLoggerFunc(_ context.Context, logger log.Logger) log.Logger {
return logger
}

// WithRequestLoggerFunc sets the BucketStore to use the passed RequestLoggerFunc
// to initialize logger during query time.
func WithRequestLoggerFunc(loggerFunc RequestLoggerFunc) BucketStoreOption {
Expand Down Expand Up @@ -595,9 +599,7 @@ func NewBucketStore(
seriesBatchSize: SeriesBatchSize,
sortingStrategy: sortingStrategyStore,
indexHeaderLazyDownloadStrategy: indexheader.AlwaysEagerDownloadIndexHeader,
requestLoggerFunc: func(ctx context.Context, logger log.Logger) log.Logger {
return logger
},
requestLoggerFunc: NoopRequestLoggerFunc,
}

for _, option := range options {
Expand Down
1 change: 1 addition & 0 deletions pkg/store/bucket_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1787,6 +1787,7 @@ func TestBucketSeries_OneBlock_InMemIndexCacheSegfault(t *testing.T) {
seriesLimiterFactory: NewSeriesLimiterFactory(0),
bytesLimiterFactory: NewBytesLimiterFactory(0),
seriesBatchSize: SeriesBatchSize,
requestLoggerFunc: NoopRequestLoggerFunc,
}

t.Run("invoke series for one block. Fill the cache on the way.", func(t *testing.T) {
Expand Down

0 comments on commit 168c081

Please sign in to comment.