|
|
|
@ -195,10 +195,18 @@ func TestMergeQuerierWithChainMerger(t *testing.T) {
|
|
|
|
|
}
|
|
|
|
|
qs = append(qs, tc.extraQueriers...)
|
|
|
|
|
|
|
|
|
|
merged, _, _ := NewMergeQuerier(qs[0], qs, ChainedSeriesMerge).Select(false, nil)
|
|
|
|
|
for merged.Next() {
|
|
|
|
|
mergedQuerier, _, _ := NewMergeQuerier(qs[0], qs, ChainedSeriesMerge).Select(false, nil)
|
|
|
|
|
|
|
|
|
|
// Get all merged series upfront to make sure there are no incorrectly retained shared
|
|
|
|
|
// buffers causing bugs.
|
|
|
|
|
var mergedSeries []Series
|
|
|
|
|
for mergedQuerier.Next() {
|
|
|
|
|
mergedSeries = append(mergedSeries, mergedQuerier.At())
|
|
|
|
|
}
|
|
|
|
|
testutil.Ok(t, mergedQuerier.Err())
|
|
|
|
|
|
|
|
|
|
for _, actualSeries := range mergedSeries {
|
|
|
|
|
testutil.Assert(t, tc.expected.Next(), "Expected Next() to be true")
|
|
|
|
|
actualSeries := merged.At()
|
|
|
|
|
expectedSeries := tc.expected.At()
|
|
|
|
|
testutil.Equals(t, expectedSeries.Labels(), actualSeries.Labels())
|
|
|
|
|
|
|
|
|
@ -207,7 +215,6 @@ func TestMergeQuerierWithChainMerger(t *testing.T) {
|
|
|
|
|
testutil.Equals(t, expErr, actErr)
|
|
|
|
|
testutil.Equals(t, expSmpl, actSmpl)
|
|
|
|
|
}
|
|
|
|
|
testutil.Ok(t, merged.Err())
|
|
|
|
|
testutil.Assert(t, !tc.expected.Next(), "Expected Next() to be false")
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|