MCPcopy
hub / github.com/prometheus/prometheus / TestBufferedSeriesIteratorNoBadAt

Function TestBufferedSeriesIteratorNoBadAt

storage/buffer_test.go:302–324  ·  view source on GitHub ↗

At() should not be called once Next() returns false.

(t *testing.T)

Source from the content-addressed store, hash-verified

300
301// At() should not be called once Next() returns false.
302func TestBufferedSeriesIteratorNoBadAt(t *testing.T) {
303 done := false
304
305 m := &mockSeriesIterator{
306 seek: func(int64) chunkenc.ValueType { return chunkenc.ValNone },
307 at: func() (int64, float64) {
308 require.False(t, done, "unexpectedly done")
309 done = true
310 return 0, 0
311 },
312 next: func() chunkenc.ValueType {
313 if done {
314 return chunkenc.ValNone
315 }
316 return chunkenc.ValFloat
317 },
318 err: func() error { return nil },
319 }
320
321 it := NewBufferIterator(m, 60)
322 it.Next()
323 it.Next()
324}
325
326func TestBufferedSeriesIteratorMixedHistograms(t *testing.T) {
327 histograms := tsdbutil.GenerateTestHistograms(2)

Callers

nothing calls this directly

Calls 2

NewBufferIteratorFunction · 0.85
NextMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…