@@ -19,13 +19,13 @@ import (
1919 "github.com/cortexproject/cortex/pkg/storage/bucket"
2020 "github.com/cortexproject/cortex/pkg/util/services"
2121 "github.com/cortexproject/cortex/pkg/util/test"
22- cotex_testutil "github.com/cortexproject/cortex/pkg/util/testutil"
22+ cortex_testutil "github.com/cortexproject/cortex/pkg/util/testutil"
2323)
2424
2525func TestLoader_GetIndex_ShouldLazyLoadBucketIndex (t * testing.T ) {
2626 ctx := context .Background ()
2727 reg := prometheus .NewPedanticRegistry ()
28- bkt , _ := cotex_testutil .PrepareFilesystemBucket (t )
28+ bkt , _ := cortex_testutil .PrepareFilesystemBucket (t )
2929
3030 // Create a bucket index.
3131 idx := & Index {
@@ -90,7 +90,7 @@ func TestLoader_GetIndex_ShouldLazyLoadBucketIndex(t *testing.T) {
9090func TestLoader_GetIndex_ShouldCacheError (t * testing.T ) {
9191 ctx := context .Background ()
9292 reg := prometheus .NewPedanticRegistry ()
93- bkt , _ := cotex_testutil .PrepareFilesystemBucket (t )
93+ bkt , _ := cortex_testutil .PrepareFilesystemBucket (t )
9494
9595 // Create the loader.
9696 loader := NewLoader (prepareLoaderConfig (), bkt , nil , log .NewNopLogger (), reg )
@@ -129,7 +129,7 @@ func TestLoader_GetIndex_ShouldCacheError(t *testing.T) {
129129func TestLoader_GetIndex_ShouldCacheIndexNotFoundError (t * testing.T ) {
130130 ctx := context .Background ()
131131 reg := prometheus .NewPedanticRegistry ()
132- bkt , _ := cotex_testutil .PrepareFilesystemBucket (t )
132+ bkt , _ := cortex_testutil .PrepareFilesystemBucket (t )
133133
134134 // Create the loader.
135135 loader := NewLoader (prepareLoaderConfig (), bkt , nil , log .NewNopLogger (), reg )
@@ -165,7 +165,7 @@ func TestLoader_GetIndex_ShouldCacheIndexNotFoundError(t *testing.T) {
165165func TestLoader_ShouldNotCacheContextCancelled (t * testing.T ) {
166166 ctx := context .Background ()
167167 reg := prometheus .NewPedanticRegistry ()
168- bkt , _ := cotex_testutil .PrepareFilesystemBucket (t )
168+ bkt , _ := cortex_testutil .PrepareFilesystemBucket (t )
169169
170170 // Create a bucket index.
171171 idx := & Index {
@@ -205,7 +205,7 @@ func TestLoader_ShouldNotCacheContextCancelled(t *testing.T) {
205205func TestLoader_ShouldUpdateIndexInBackgroundOnPreviousLoadSuccess (t * testing.T ) {
206206 ctx := context .Background ()
207207 reg := prometheus .NewPedanticRegistry ()
208- bkt , _ := cotex_testutil .PrepareFilesystemBucket (t )
208+ bkt , _ := cortex_testutil .PrepareFilesystemBucket (t )
209209
210210 // Create a bucket index.
211211 idx := & Index {
@@ -270,7 +270,7 @@ func TestLoader_ShouldUpdateIndexInBackgroundOnPreviousLoadSuccess(t *testing.T)
270270func TestLoader_ShouldUpdateIndexInBackgroundOnPreviousLoadFailure (t * testing.T ) {
271271 ctx := context .Background ()
272272 reg := prometheus .NewPedanticRegistry ()
273- bkt , _ := cotex_testutil .PrepareFilesystemBucket (t )
273+ bkt , _ := cortex_testutil .PrepareFilesystemBucket (t )
274274
275275 // Write a corrupted index.
276276 require .NoError (t , bkt .Upload (ctx , path .Join ("user-1" , IndexCompressedFilename ), strings .NewReader ("invalid!}" )))
@@ -326,7 +326,7 @@ func TestLoader_ShouldUpdateIndexInBackgroundOnPreviousLoadFailure(t *testing.T)
326326func TestLoader_ShouldUpdateIndexInBackgroundOnPreviousIndexNotFound (t * testing.T ) {
327327 ctx := context .Background ()
328328 reg := prometheus .NewPedanticRegistry ()
329- bkt , _ := cotex_testutil .PrepareFilesystemBucket (t )
329+ bkt , _ := cortex_testutil .PrepareFilesystemBucket (t )
330330
331331 // Create the loader.
332332 cfg := LoaderConfig {
@@ -379,7 +379,7 @@ func TestLoader_ShouldUpdateIndexInBackgroundOnPreviousIndexNotFound(t *testing.
379379func TestLoader_ShouldNotCacheCriticalErrorOnBackgroundUpdates (t * testing.T ) {
380380 ctx := context .Background ()
381381 reg := prometheus .NewPedanticRegistry ()
382- bkt , _ := cotex_testutil .PrepareFilesystemBucket (t )
382+ bkt , _ := cortex_testutil .PrepareFilesystemBucket (t )
383383
384384 // Create a bucket index.
385385 idx := & Index {
@@ -435,7 +435,7 @@ func TestLoader_ShouldNotCacheCriticalErrorOnBackgroundUpdates(t *testing.T) {
435435func TestLoader_ShouldCacheIndexNotFoundOnBackgroundUpdates (t * testing.T ) {
436436 ctx := context .Background ()
437437 reg := prometheus .NewPedanticRegistry ()
438- bkt , _ := cotex_testutil .PrepareFilesystemBucket (t )
438+ bkt , _ := cortex_testutil .PrepareFilesystemBucket (t )
439439
440440 // Create a bucket index.
441441 idx := & Index {
@@ -495,7 +495,7 @@ func TestLoader_ShouldCacheIndexNotFoundOnBackgroundUpdates(t *testing.T) {
495495func TestLoader_ShouldOffloadIndexIfNotFoundDuringBackgroundUpdates (t * testing.T ) {
496496 ctx := context .Background ()
497497 reg := prometheus .NewPedanticRegistry ()
498- bkt , _ := cotex_testutil .PrepareFilesystemBucket (t )
498+ bkt , _ := cortex_testutil .PrepareFilesystemBucket (t )
499499
500500 // Create a bucket index.
501501 idx := & Index {
@@ -550,7 +550,7 @@ func TestLoader_ShouldOffloadIndexIfNotFoundDuringBackgroundUpdates(t *testing.T
550550func TestLoader_ShouldOffloadIndexIfIdleTimeoutIsReachedDuringBackgroundUpdates (t * testing.T ) {
551551 ctx := context .Background ()
552552 reg := prometheus .NewPedanticRegistry ()
553- bkt , _ := cotex_testutil .PrepareFilesystemBucket (t )
553+ bkt , _ := cortex_testutil .PrepareFilesystemBucket (t )
554554
555555 // Create a bucket index.
556556 idx := & Index {
@@ -618,7 +618,7 @@ func TestLoader_ShouldUpdateIndexInBackgroundOnPreviousKeyAccessDenied(t *testin
618618 user := "user-1"
619619 ctx := context .Background ()
620620 reg := prometheus .NewPedanticRegistry ()
621- bkt , _ := cotex_testutil .PrepareFilesystemBucket (t )
621+ bkt , _ := cortex_testutil .PrepareFilesystemBucket (t )
622622
623623 // Create the loader.
624624 cfg := LoaderConfig {
@@ -628,10 +628,10 @@ func TestLoader_ShouldUpdateIndexInBackgroundOnPreviousKeyAccessDenied(t *testin
628628 IdleTimeout : time .Hour , // Intentionally high to not hit it.
629629 }
630630
631- mockedBkt := & cotex_testutil .MockBucketFailure {
631+ mockedBkt := & cortex_testutil .MockBucketFailure {
632632 Bucket : bkt ,
633633 GetFailures : map [string ]error {
634- path .Join (user , "bucket-index.json.gz" ): cotex_testutil .ErrKeyAccessDeniedError ,
634+ path .Join (user , "bucket-index.json.gz" ): cortex_testutil .ErrKeyAccessDeniedError ,
635635 },
636636 }
637637
@@ -706,12 +706,12 @@ func TestLoader_GetIndex_ShouldCacheKeyDeniedErrors(t *testing.T) {
706706 user := "user-1"
707707 ctx := context .Background ()
708708 reg := prometheus .NewPedanticRegistry ()
709- bkt , _ := cotex_testutil .PrepareFilesystemBucket (t )
709+ bkt , _ := cortex_testutil .PrepareFilesystemBucket (t )
710710
711- bkt = & cotex_testutil .MockBucketFailure {
711+ bkt = & cortex_testutil .MockBucketFailure {
712712 Bucket : bkt ,
713713 GetFailures : map [string ]error {
714- path .Join (user , "bucket-index.json.gz" ): cotex_testutil .ErrKeyAccessDeniedError ,
714+ path .Join (user , "bucket-index.json.gz" ): cortex_testutil .ErrKeyAccessDeniedError ,
715715 },
716716 }
717717
0 commit comments