mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-09 23:24:05 -08:00
storage: expose bug in iterators #10027
Signed-off-by: beorn7 <beorn@grafana.com>
This commit is contained in:
parent
52c693a63b
commit
b042e29569
|
@ -233,6 +233,11 @@ func TestConcreteSeriesIterator(t *testing.T) {
|
||||||
ts, v = it.At()
|
ts, v = it.At()
|
||||||
require.Equal(t, int64(3), ts)
|
require.Equal(t, int64(3), ts)
|
||||||
require.Equal(t, 3., v)
|
require.Equal(t, 3., v)
|
||||||
|
|
||||||
|
// Seek beyond the end.
|
||||||
|
require.False(t, it.Seek(5))
|
||||||
|
// And we don't go back. (This exposes issue #10027.)
|
||||||
|
require.False(t, it.Seek(2))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestFromQueryResultWithDuplicates(t *testing.T) {
|
func TestFromQueryResultWithDuplicates(t *testing.T) {
|
||||||
|
|
|
@ -51,4 +51,9 @@ func TestListSeriesIterator(t *testing.T) {
|
||||||
ts, v = it.At()
|
ts, v = it.At()
|
||||||
require.Equal(t, int64(3), ts)
|
require.Equal(t, int64(3), ts)
|
||||||
require.Equal(t, 3., v)
|
require.Equal(t, 3., v)
|
||||||
|
|
||||||
|
// Seek beyond the end.
|
||||||
|
require.False(t, it.Seek(5))
|
||||||
|
// And we don't go back. (This exposes issue #10027.)
|
||||||
|
require.False(t, it.Seek(2))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue