Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Le <[email protected]>
  • Loading branch information
alexqyle committed Oct 25, 2023
1 parent 8aea20d commit cdc8f8d
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 94 deletions.
36 changes: 18 additions & 18 deletions pkg/querier/blocks_consistency_checker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,52 +36,52 @@ func TestBlocksConsistencyChecker_Check(t *testing.T) {
},
"all known blocks have been queried from a single store-gateway": {
knownBlocks: bucketindex.Blocks{
{ID: block1, UploadedAt: now.Add(-time.Hour).Unix()},
{ID: block2, UploadedAt: now.Add(-time.Hour).Unix()},
&bucketindex.Block{ID: block1, UploadedAt: now.Add(-time.Hour).Unix()},
&bucketindex.Block{ID: block2, UploadedAt: now.Add(-time.Hour).Unix()},
},
knownDeletionMarks: map[ulid.ULID]*bucketindex.BlockDeletionMark{},
queriedBlocks: []ulid.ULID{block1, block2},
},
"all known blocks have been queried from multiple store-gateway": {
knownBlocks: bucketindex.Blocks{
{ID: block1, UploadedAt: now.Add(-time.Hour).Unix()},
{ID: block2, UploadedAt: now.Add(-time.Hour).Unix()},
&bucketindex.Block{ID: block1, UploadedAt: now.Add(-time.Hour).Unix()},
&bucketindex.Block{ID: block2, UploadedAt: now.Add(-time.Hour).Unix()},
},
knownDeletionMarks: map[ulid.ULID]*bucketindex.BlockDeletionMark{},
queriedBlocks: []ulid.ULID{block1, block2},
},
"store-gateway has queried more blocks than expected": {
knownBlocks: bucketindex.Blocks{
{ID: block1, UploadedAt: now.Add(-time.Hour).Unix()},
{ID: block2, UploadedAt: now.Add(-time.Hour).Unix()},
&bucketindex.Block{ID: block1, UploadedAt: now.Add(-time.Hour).Unix()},
&bucketindex.Block{ID: block2, UploadedAt: now.Add(-time.Hour).Unix()},
},
knownDeletionMarks: map[ulid.ULID]*bucketindex.BlockDeletionMark{},
queriedBlocks: []ulid.ULID{block1, block2, block3},
},
"store-gateway has queried less blocks than expected": {
knownBlocks: bucketindex.Blocks{
{ID: block1, UploadedAt: now.Add(-time.Hour).Unix()},
{ID: block2, UploadedAt: now.Add(-time.Hour).Unix()},
{ID: block3, UploadedAt: now.Add(-time.Hour).Unix()},
&bucketindex.Block{ID: block1, UploadedAt: now.Add(-time.Hour).Unix()},
&bucketindex.Block{ID: block2, UploadedAt: now.Add(-time.Hour).Unix()},
&bucketindex.Block{ID: block3, UploadedAt: now.Add(-time.Hour).Unix()},
},
knownDeletionMarks: map[ulid.ULID]*bucketindex.BlockDeletionMark{},
queriedBlocks: []ulid.ULID{block1, block3},
expectedMissingBlocks: []ulid.ULID{block2},
},
"store-gateway has queried less blocks than expected, but the missing block has been recently uploaded": {
knownBlocks: bucketindex.Blocks{
{ID: block1, UploadedAt: now.Add(-time.Hour).Unix()},
{ID: block2, UploadedAt: now.Add(-time.Hour).Unix()},
{ID: block3, UploadedAt: now.Add(-uploadGracePeriod).Add(time.Minute).Unix()},
&bucketindex.Block{ID: block1, UploadedAt: now.Add(-time.Hour).Unix()},
&bucketindex.Block{ID: block2, UploadedAt: now.Add(-time.Hour).Unix()},
&bucketindex.Block{ID: block3, UploadedAt: now.Add(-uploadGracePeriod).Add(time.Minute).Unix()},
},
knownDeletionMarks: map[ulid.ULID]*bucketindex.BlockDeletionMark{},
queriedBlocks: []ulid.ULID{block1, block2},
},
"store-gateway has queried less blocks than expected and the missing block has been recently marked for deletion": {
knownBlocks: bucketindex.Blocks{
{ID: block1, UploadedAt: now.Add(-time.Hour).Unix()},
{ID: block2, UploadedAt: now.Add(-time.Hour).Unix()},
{ID: block3, UploadedAt: now.Add(-time.Hour).Unix()},
&bucketindex.Block{ID: block1, UploadedAt: now.Add(-time.Hour).Unix()},
&bucketindex.Block{ID: block2, UploadedAt: now.Add(-time.Hour).Unix()},
&bucketindex.Block{ID: block3, UploadedAt: now.Add(-time.Hour).Unix()},
},
knownDeletionMarks: map[ulid.ULID]*bucketindex.BlockDeletionMark{
block3: {DeletionTime: now.Add(-deletionGracePeriod / 2).Unix()},
Expand All @@ -91,9 +91,9 @@ func TestBlocksConsistencyChecker_Check(t *testing.T) {
},
"store-gateway has queried less blocks than expected and the missing block has been marked for deletion long time ago": {
knownBlocks: bucketindex.Blocks{
{ID: block1, UploadedAt: now.Add(-time.Hour).Unix()},
{ID: block2, UploadedAt: now.Add(-time.Hour).Unix()},
{ID: block3, UploadedAt: now.Add(-time.Hour).Unix()},
&bucketindex.Block{ID: block1, UploadedAt: now.Add(-time.Hour).Unix()},
&bucketindex.Block{ID: block2, UploadedAt: now.Add(-time.Hour).Unix()},
&bucketindex.Block{ID: block3, UploadedAt: now.Add(-time.Hour).Unix()},
},
knownDeletionMarks: map[ulid.ULID]*bucketindex.BlockDeletionMark{
block3: {DeletionTime: now.Add(-deletionGracePeriod * 2).Unix()},
Expand Down
Loading

0 comments on commit cdc8f8d

Please sign in to comment.