Skip to content

Commit

Permalink
sort block ids in BlockIDsFetcherFetcher test
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Ye <[email protected]>
  • Loading branch information
yeya24 committed Apr 11, 2024
1 parent 26c389a commit 92f2e98
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/storage/tsdb/bucketindex/block_ids_fetcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"context"
"encoding/json"
"path"
"sort"
"sync"
"testing"
"time"
Expand Down Expand Up @@ -109,5 +110,8 @@ func TestBlockIDsFetcherFetcher_Fetch_NoBucketIndex(t *testing.T) {
require.NoError(t, err)
close(ch)
wg.Wait()
sort.Slice(blockIds, func(i, j int) bool {
return blockIds[i].Compare(blockIds[j]) < 0
})
require.Equal(t, []ulid.ULID{block1.ID, block2.ID, block3.ID}, blockIds)
}

0 comments on commit 92f2e98

Please sign in to comment.