storage: iterator fixes after merge
Signed-off-by: beorn7 <beorn@grafana.com>
This commit is contained in:
parent
64c7bd2b08
commit
86cc83b13c
|
@ -2830,7 +2830,7 @@ func TestScrapeReportLimit(t *testing.T) {
|
|||
var found bool
|
||||
for series.Next() {
|
||||
i := series.At().Iterator()
|
||||
for i.Next() {
|
||||
for i.Next() == chunkenc.ValFloat {
|
||||
_, v := i.At()
|
||||
require.Equal(t, 1.0, v)
|
||||
found = true
|
||||
|
|
|
@ -363,7 +363,7 @@ func (c *concreteSeriesIterator) Seek(t int64) chunkenc.ValueType {
|
|||
c.cur = 0
|
||||
}
|
||||
if c.cur >= len(c.series.samples) {
|
||||
return false
|
||||
return chunkenc.ValNone
|
||||
}
|
||||
// No-op check.
|
||||
if s := c.series.samples[c.cur]; s.Timestamp >= t {
|
||||
|
|
|
@ -236,9 +236,9 @@ func TestConcreteSeriesIterator(t *testing.T) {
|
|||
require.Equal(t, 3., v)
|
||||
|
||||
// Seek beyond the end.
|
||||
require.False(t, it.Seek(5))
|
||||
require.Equal(t, chunkenc.ValNone, it.Seek(5))
|
||||
// And we don't go back. (This exposes issue #10027.)
|
||||
require.False(t, it.Seek(2))
|
||||
require.Equal(t, chunkenc.ValNone, it.Seek(2))
|
||||
}
|
||||
|
||||
func TestFromQueryResultWithDuplicates(t *testing.T) {
|
||||
|
|
|
@ -119,7 +119,7 @@ func (it *listSeriesIterator) Seek(t int64) chunkenc.ValueType {
|
|||
it.idx = 0
|
||||
}
|
||||
if it.idx >= it.samples.Len() {
|
||||
return false
|
||||
return chunkenc.ValNone
|
||||
}
|
||||
// No-op check.
|
||||
if s := it.samples.Get(it.idx); s.T() >= t {
|
||||
|
|
|
@ -61,7 +61,7 @@ func TestListSeriesIterator(t *testing.T) {
|
|||
require.Equal(t, 3., v)
|
||||
|
||||
// Seek beyond the end.
|
||||
require.False(t, it.Seek(5))
|
||||
require.Equal(t, chunkenc.ValNone, it.Seek(5))
|
||||
// And we don't go back. (This exposes issue #10027.)
|
||||
require.False(t, it.Seek(2))
|
||||
require.Equal(t, chunkenc.ValNone, it.Seek(2))
|
||||
}
|
||||
|
|
|
@ -181,7 +181,7 @@ func (it *listSeriesIterator) Seek(t int64) chunkenc.ValueType {
|
|||
it.idx = 0
|
||||
}
|
||||
if it.idx >= len(it.list) {
|
||||
return false
|
||||
return chunkenc.ValNone
|
||||
}
|
||||
// No-op check.
|
||||
if s := it.list[it.idx]; s.t >= t {
|
||||
|
|
Loading…
Reference in New Issue