@@ -175,6 +175,41 @@ func TestMergedSeriesIterator(t *testing.T) {
175175 },
176176 },
177177 },
178+ {
179+ name : "Avoid corrupt Values" ,
180+ input : []series {
181+ {
182+ lset : labels.Labels {{Name : "a" , Value : "5" }, {Name : "c" , Value : "6" }},
183+ samples : []sample {{10000 , 1 }, {20000 , 23492 }, {30000 , 3 }, {50000 , 5 }},
184+ }, {
185+ lset : labels.Labels {{Name : "a" , Value : "5" }, {Name : "c" , Value : "6" }},
186+ samples : []sample {{10000 , 1 }, {20000 , 2 }, {30000 , 3 }, {50000 , 5 }},
187+ }, {
188+ lset : labels.Labels {{Name : "a" , Value : "5" }, {Name : "c" , Value : "6" }},
189+ samples : []sample {{10000 , 1 }, {20000 , 2 }, {30000 , 3 }, {50000 , 5 }},
190+ },
191+ {
192+ lset : labels.Labels {{Name : "b" , Value : "5" }, {Name : "c" , Value : "6" }},
193+ samples : []sample {{10000 , 1 }, {20000 , 2 }, {30000 , 3 }, {50000 , 5 }},
194+ }, {
195+ lset : labels.Labels {{Name : "b" , Value : "5" }, {Name : "c" , Value : "6" }},
196+ samples : []sample {{10000 , 1 }, {20000 , 2 }, {30000 , 3 }, {50000 , 5 }},
197+ }, {
198+ lset : labels.Labels {{Name : "b" , Value : "5" }, {Name : "c" , Value : "6" }},
199+ samples : []sample {{10000 , 1 }, {20000 , 1234 }, {30000 , 3 }, {50000 , 5 }},
200+ },
201+ },
202+ exp : []series {
203+ {
204+ lset : labels.Labels {{Name : "a" , Value : "5" }, {Name : "c" , Value : "6" }},
205+ samples : []sample {{10000 , 1 }, {20000 , 2 }, {30000 , 3 }, {50000 , 5 }},
206+ },
207+ {
208+ lset : labels.Labels {{Name : "b" , Value : "5" }, {Name : "c" , Value : "6" }},
209+ samples : []sample {{10000 , 1 }, {20000 , 2 }, {30000 , 3 }, {50000 , 5 }},
210+ },
211+ },
212+ },
178213 {
179214 name : "ignore sampling interval too small" ,
180215 input : []series {
0 commit comments