Skip to content

Commit

Permalink
Fix PostingsCloner tests
Browse files Browse the repository at this point in the history
Signed-off-by: Arve Knudsen <[email protected]>
  • Loading branch information
aknuds1 committed Oct 9, 2023
1 parent 35ab759 commit a7737ab
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions tsdb/index/postings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -990,19 +990,16 @@ func TestPostingsCloner(t *testing.T) {
check: func(t testing.TB, pc *PostingsCloner) {
p1 := pc.Clone()
require.False(t, p1.Seek(9))
require.Equal(t, storage.SeriesRef(0), p1.At())

p2 := pc.Clone()
require.False(t, p2.Seek(10))
require.Equal(t, storage.SeriesRef(0), p2.At())
},
},
{
name: "seek beyond highest value of postings, then other clone seeks lower",
check: func(t testing.TB, pc *PostingsCloner) {
p1 := pc.Clone()
require.False(t, p1.Seek(9))
require.Equal(t, storage.SeriesRef(0), p1.At())

p2 := pc.Clone()
require.True(t, p2.Seek(2))
Expand Down Expand Up @@ -1070,21 +1067,12 @@ func TestPostingsCloner(t *testing.T) {
require.Equal(t, storage.SeriesRef(4), p2.At())
},
},
{
name: "at before call of next shouldn't panic",
check: func(t testing.TB, pc *PostingsCloner) {
p := pc.Clone()
require.Equal(t, storage.SeriesRef(0), p.At())
},
},
{
name: "ensure a failed seek doesn't allow more next calls",
check: func(t testing.TB, pc *PostingsCloner) {
p := pc.Clone()
require.False(t, p.Seek(9))
require.Equal(t, storage.SeriesRef(0), p.At())
require.False(t, p.Next())
require.Equal(t, storage.SeriesRef(0), p.At())
},
},
} {
Expand Down

0 comments on commit a7737ab

Please sign in to comment.