diff --git a/pkg/bloomutils/ring_test.go b/pkg/bloomutils/ring_test.go index 13cd5d81c5a27..342656cff4226 100644 --- a/pkg/bloomutils/ring_test.go +++ b/pkg/bloomutils/ring_test.go @@ -6,8 +6,6 @@ import ( "github.com/grafana/dskit/ring" "github.com/stretchr/testify/require" - - v1 "github.com/grafana/loki/pkg/storage/bloom/v1" ) func TestBloomGatewayClient_InstanceSortMergeIterator(t *testing.T) { @@ -33,11 +31,15 @@ func TestBloomGatewayClient_InstanceSortMergeIterator(t *testing.T) { } } +func uint64Range(min, max uint64) Range[uint64] { + return Range[uint64]{min, max} +} + func TestBloomGatewayClient_KeyRangeForInstance(t *testing.T) { for name, tc := range map[string]struct { id string input []ring.InstanceDesc - expected v1.FingerprintBounds + expected Range[uint64] }{ "first instance includes 0 token": { id: "3", @@ -46,7 +48,7 @@ func TestBloomGatewayClient_KeyRangeForInstance(t *testing.T) { {Id: "2", Tokens: []uint32{5}}, {Id: "3", Tokens: []uint32{1}}, }, - expected: v1.NewBounds(0, math.MaxUint64/3-1), + expected: uint64Range(0, math.MaxUint64/3-1), }, "middle instance": { id: "1", @@ -55,7 +57,7 @@ func TestBloomGatewayClient_KeyRangeForInstance(t *testing.T) { {Id: "2", Tokens: []uint32{5}}, {Id: "3", Tokens: []uint32{1}}, }, - expected: v1.NewBounds(math.MaxUint64/3, math.MaxUint64/3*2-1), + expected: uint64Range(math.MaxUint64/3, math.MaxUint64/3*2-1), }, "last instance includes MaxUint32 token": { id: "2", @@ -64,12 +66,12 @@ func TestBloomGatewayClient_KeyRangeForInstance(t *testing.T) { {Id: "2", Tokens: []uint32{5}}, {Id: "3", Tokens: []uint32{1}}, }, - expected: v1.NewBounds(math.MaxUint64/3*2, math.MaxUint64), + expected: uint64Range(math.MaxUint64/3*2, math.MaxUint64), }, } { tc := tc t.Run(name, func(t *testing.T) { - result, err := KeyRangeForInstance(tc.id, tc.input, Uint32Range) + result, err := KeyRangeForInstance(tc.id, tc.input, Uint64Range) require.NoError(t, err) require.Equal(t, tc.expected, result) })