mirror of
https://github.com/prometheus/prometheus.git
synced 2026-03-06 06:01:42 +01:00
fix issue with seeking to last sample again
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
This commit is contained in:
parent
091379dc44
commit
ca530d7f85
@ -110,10 +110,14 @@ func testChunk(t *testing.T, c Chunk, supportsST bool) {
|
||||
ts, v = it3.At()
|
||||
res3 = append(res3, triple{st: it3.AtST(), t: ts, v: v})
|
||||
|
||||
lastTs := ts
|
||||
for it3.Next() == ValFloat {
|
||||
ts, v := it3.At()
|
||||
lastTs = ts
|
||||
res3 = append(res3, triple{st: it3.AtST(), t: ts, v: v})
|
||||
}
|
||||
// Seeking to last timestamp should work and it is a no-op.
|
||||
require.Equal(t, ValFloat, it3.Seek(lastTs))
|
||||
require.NoError(t, it3.Err())
|
||||
require.Equal(t, exp[mid:], res3)
|
||||
require.Equal(t, ValNone, it3.Seek(exp[len(exp)-1].t+1))
|
||||
|
||||
@ -207,7 +207,7 @@ type xorOptSTtIterator struct {
|
||||
}
|
||||
|
||||
func (it *xorOptSTtIterator) Seek(t int64) ValueType {
|
||||
if it.state == eofState {
|
||||
if it.err != nil {
|
||||
return ValNone
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user