|
|
@ -481,10 +481,10 @@ func testOOOHeadChunkReader_Chunk(t *testing.T, scenario sampleTypeScenario) {
|
|
|
|
t.Run("Getting a non existing chunk fails with not found error", func(t *testing.T) {
|
|
|
|
t.Run("Getting a non existing chunk fails with not found error", func(t *testing.T) {
|
|
|
|
db := newTestDBWithOpts(t, opts)
|
|
|
|
db := newTestDBWithOpts(t, opts)
|
|
|
|
|
|
|
|
|
|
|
|
cr := NewOOOHeadChunkReader(db.head, 0, 1000, nil, 0)
|
|
|
|
cr := NewHeadAndOOOChunkReader(db.head, 0, 1000, nil, nil, 0)
|
|
|
|
defer cr.Close()
|
|
|
|
defer cr.Close()
|
|
|
|
c, iterable, err := cr.ChunkOrIterable(chunks.Meta{
|
|
|
|
c, iterable, err := cr.ChunkOrIterable(chunks.Meta{
|
|
|
|
Ref: 0x1000000, Chunk: chunkenc.Chunk(nil), MinTime: 100, MaxTime: 300,
|
|
|
|
Ref: 0x1800000, Chunk: chunkenc.Chunk(nil), MinTime: 100, MaxTime: 300,
|
|
|
|
})
|
|
|
|
})
|
|
|
|
require.Nil(t, iterable)
|
|
|
|
require.Nil(t, iterable)
|
|
|
|
require.Equal(t, err, fmt.Errorf("not found"))
|
|
|
|
require.Equal(t, err, fmt.Errorf("not found"))
|
|
|
@ -839,7 +839,7 @@ func testOOOHeadChunkReader_Chunk(t *testing.T, scenario sampleTypeScenario) {
|
|
|
|
require.NoError(t, err)
|
|
|
|
require.NoError(t, err)
|
|
|
|
require.Equal(t, len(tc.expChunksSamples), len(chks))
|
|
|
|
require.Equal(t, len(tc.expChunksSamples), len(chks))
|
|
|
|
|
|
|
|
|
|
|
|
cr := NewOOOHeadChunkReader(db.head, tc.queryMinT, tc.queryMaxT, nil, 0)
|
|
|
|
cr := NewHeadAndOOOChunkReader(db.head, tc.queryMinT, tc.queryMaxT, nil, nil, 0)
|
|
|
|
defer cr.Close()
|
|
|
|
defer cr.Close()
|
|
|
|
for i := 0; i < len(chks); i++ {
|
|
|
|
for i := 0; i < len(chks); i++ {
|
|
|
|
c, iterable, err := cr.ChunkOrIterable(chks[i])
|
|
|
|
c, iterable, err := cr.ChunkOrIterable(chks[i])
|
|
|
@ -1013,7 +1013,7 @@ func testOOOHeadChunkReader_Chunk_ConsistentQueryResponseDespiteOfHeadExpanding(
|
|
|
|
}
|
|
|
|
}
|
|
|
|
require.NoError(t, app.Commit())
|
|
|
|
require.NoError(t, app.Commit())
|
|
|
|
|
|
|
|
|
|
|
|
cr := NewOOOHeadChunkReader(db.head, tc.queryMinT, tc.queryMaxT, nil, 0)
|
|
|
|
cr := NewHeadAndOOOChunkReader(db.head, tc.queryMinT, tc.queryMaxT, nil, nil, 0)
|
|
|
|
defer cr.Close()
|
|
|
|
defer cr.Close()
|
|
|
|
for i := 0; i < len(chks); i++ {
|
|
|
|
for i := 0; i < len(chks); i++ {
|
|
|
|
c, iterable, err := cr.ChunkOrIterable(chks[i])
|
|
|
|
c, iterable, err := cr.ChunkOrIterable(chks[i])
|
|
|
|