@@ -19,13 +19,13 @@ import (
19
19
"github.com/cortexproject/cortex/pkg/storage/bucket"
20
20
"github.com/cortexproject/cortex/pkg/util/services"
21
21
"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"
23
23
)
24
24
25
25
func TestLoader_GetIndex_ShouldLazyLoadBucketIndex (t * testing.T ) {
26
26
ctx := context .Background ()
27
27
reg := prometheus .NewPedanticRegistry ()
28
- bkt , _ := cotex_testutil .PrepareFilesystemBucket (t )
28
+ bkt , _ := cortex_testutil .PrepareFilesystemBucket (t )
29
29
30
30
// Create a bucket index.
31
31
idx := & Index {
@@ -90,7 +90,7 @@ func TestLoader_GetIndex_ShouldLazyLoadBucketIndex(t *testing.T) {
90
90
func TestLoader_GetIndex_ShouldCacheError (t * testing.T ) {
91
91
ctx := context .Background ()
92
92
reg := prometheus .NewPedanticRegistry ()
93
- bkt , _ := cotex_testutil .PrepareFilesystemBucket (t )
93
+ bkt , _ := cortex_testutil .PrepareFilesystemBucket (t )
94
94
95
95
// Create the loader.
96
96
loader := NewLoader (prepareLoaderConfig (), bkt , nil , log .NewNopLogger (), reg )
@@ -129,7 +129,7 @@ func TestLoader_GetIndex_ShouldCacheError(t *testing.T) {
129
129
func TestLoader_GetIndex_ShouldCacheIndexNotFoundError (t * testing.T ) {
130
130
ctx := context .Background ()
131
131
reg := prometheus .NewPedanticRegistry ()
132
- bkt , _ := cotex_testutil .PrepareFilesystemBucket (t )
132
+ bkt , _ := cortex_testutil .PrepareFilesystemBucket (t )
133
133
134
134
// Create the loader.
135
135
loader := NewLoader (prepareLoaderConfig (), bkt , nil , log .NewNopLogger (), reg )
@@ -165,7 +165,7 @@ func TestLoader_GetIndex_ShouldCacheIndexNotFoundError(t *testing.T) {
165
165
func TestLoader_ShouldNotCacheContextCancelled (t * testing.T ) {
166
166
ctx := context .Background ()
167
167
reg := prometheus .NewPedanticRegistry ()
168
- bkt , _ := cotex_testutil .PrepareFilesystemBucket (t )
168
+ bkt , _ := cortex_testutil .PrepareFilesystemBucket (t )
169
169
170
170
// Create a bucket index.
171
171
idx := & Index {
@@ -205,7 +205,7 @@ func TestLoader_ShouldNotCacheContextCancelled(t *testing.T) {
205
205
func TestLoader_ShouldUpdateIndexInBackgroundOnPreviousLoadSuccess (t * testing.T ) {
206
206
ctx := context .Background ()
207
207
reg := prometheus .NewPedanticRegistry ()
208
- bkt , _ := cotex_testutil .PrepareFilesystemBucket (t )
208
+ bkt , _ := cortex_testutil .PrepareFilesystemBucket (t )
209
209
210
210
// Create a bucket index.
211
211
idx := & Index {
@@ -270,7 +270,7 @@ func TestLoader_ShouldUpdateIndexInBackgroundOnPreviousLoadSuccess(t *testing.T)
270
270
func TestLoader_ShouldUpdateIndexInBackgroundOnPreviousLoadFailure (t * testing.T ) {
271
271
ctx := context .Background ()
272
272
reg := prometheus .NewPedanticRegistry ()
273
- bkt , _ := cotex_testutil .PrepareFilesystemBucket (t )
273
+ bkt , _ := cortex_testutil .PrepareFilesystemBucket (t )
274
274
275
275
// Write a corrupted index.
276
276
require .NoError (t , bkt .Upload (ctx , path .Join ("user-1" , IndexCompressedFilename ), strings .NewReader ("invalid!}" )))
@@ -326,7 +326,7 @@ func TestLoader_ShouldUpdateIndexInBackgroundOnPreviousLoadFailure(t *testing.T)
326
326
func TestLoader_ShouldUpdateIndexInBackgroundOnPreviousIndexNotFound (t * testing.T ) {
327
327
ctx := context .Background ()
328
328
reg := prometheus .NewPedanticRegistry ()
329
- bkt , _ := cotex_testutil .PrepareFilesystemBucket (t )
329
+ bkt , _ := cortex_testutil .PrepareFilesystemBucket (t )
330
330
331
331
// Create the loader.
332
332
cfg := LoaderConfig {
@@ -379,7 +379,7 @@ func TestLoader_ShouldUpdateIndexInBackgroundOnPreviousIndexNotFound(t *testing.
379
379
func TestLoader_ShouldNotCacheCriticalErrorOnBackgroundUpdates (t * testing.T ) {
380
380
ctx := context .Background ()
381
381
reg := prometheus .NewPedanticRegistry ()
382
- bkt , _ := cotex_testutil .PrepareFilesystemBucket (t )
382
+ bkt , _ := cortex_testutil .PrepareFilesystemBucket (t )
383
383
384
384
// Create a bucket index.
385
385
idx := & Index {
@@ -435,7 +435,7 @@ func TestLoader_ShouldNotCacheCriticalErrorOnBackgroundUpdates(t *testing.T) {
435
435
func TestLoader_ShouldCacheIndexNotFoundOnBackgroundUpdates (t * testing.T ) {
436
436
ctx := context .Background ()
437
437
reg := prometheus .NewPedanticRegistry ()
438
- bkt , _ := cotex_testutil .PrepareFilesystemBucket (t )
438
+ bkt , _ := cortex_testutil .PrepareFilesystemBucket (t )
439
439
440
440
// Create a bucket index.
441
441
idx := & Index {
@@ -495,7 +495,7 @@ func TestLoader_ShouldCacheIndexNotFoundOnBackgroundUpdates(t *testing.T) {
495
495
func TestLoader_ShouldOffloadIndexIfNotFoundDuringBackgroundUpdates (t * testing.T ) {
496
496
ctx := context .Background ()
497
497
reg := prometheus .NewPedanticRegistry ()
498
- bkt , _ := cotex_testutil .PrepareFilesystemBucket (t )
498
+ bkt , _ := cortex_testutil .PrepareFilesystemBucket (t )
499
499
500
500
// Create a bucket index.
501
501
idx := & Index {
@@ -550,7 +550,7 @@ func TestLoader_ShouldOffloadIndexIfNotFoundDuringBackgroundUpdates(t *testing.T
550
550
func TestLoader_ShouldOffloadIndexIfIdleTimeoutIsReachedDuringBackgroundUpdates (t * testing.T ) {
551
551
ctx := context .Background ()
552
552
reg := prometheus .NewPedanticRegistry ()
553
- bkt , _ := cotex_testutil .PrepareFilesystemBucket (t )
553
+ bkt , _ := cortex_testutil .PrepareFilesystemBucket (t )
554
554
555
555
// Create a bucket index.
556
556
idx := & Index {
@@ -618,7 +618,7 @@ func TestLoader_ShouldUpdateIndexInBackgroundOnPreviousKeyAccessDenied(t *testin
618
618
user := "user-1"
619
619
ctx := context .Background ()
620
620
reg := prometheus .NewPedanticRegistry ()
621
- bkt , _ := cotex_testutil .PrepareFilesystemBucket (t )
621
+ bkt , _ := cortex_testutil .PrepareFilesystemBucket (t )
622
622
623
623
// Create the loader.
624
624
cfg := LoaderConfig {
@@ -628,10 +628,10 @@ func TestLoader_ShouldUpdateIndexInBackgroundOnPreviousKeyAccessDenied(t *testin
628
628
IdleTimeout : time .Hour , // Intentionally high to not hit it.
629
629
}
630
630
631
- mockedBkt := & cotex_testutil .MockBucketFailure {
631
+ mockedBkt := & cortex_testutil .MockBucketFailure {
632
632
Bucket : bkt ,
633
633
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 ,
635
635
},
636
636
}
637
637
@@ -706,12 +706,12 @@ func TestLoader_GetIndex_ShouldCacheKeyDeniedErrors(t *testing.T) {
706
706
user := "user-1"
707
707
ctx := context .Background ()
708
708
reg := prometheus .NewPedanticRegistry ()
709
- bkt , _ := cotex_testutil .PrepareFilesystemBucket (t )
709
+ bkt , _ := cortex_testutil .PrepareFilesystemBucket (t )
710
710
711
- bkt = & cotex_testutil .MockBucketFailure {
711
+ bkt = & cortex_testutil .MockBucketFailure {
712
712
Bucket : bkt ,
713
713
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 ,
715
715
},
716
716
}
717
717
0 commit comments