Browse Source

storage: expose bug in iterators #10027

Signed-off-by: beorn7 <beorn@grafana.com>
pull/10030/head
beorn7 3 years ago
parent
commit
b042e29569
  1. 5
      storage/remote/codec_test.go
  2. 5
      storage/series_test.go

5
storage/remote/codec_test.go

@ -233,6 +233,11 @@ func TestConcreteSeriesIterator(t *testing.T) {
ts, v = it.At()
require.Equal(t, int64(3), ts)
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) {

5
storage/series_test.go

@ -51,4 +51,9 @@ func TestListSeriesIterator(t *testing.T) {
ts, v = it.At()
require.Equal(t, int64(3), ts)
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…
Cancel
Save