Skip to content

Commit b48bc9d

Browse files
committed
Add testcase from issue 14172
Add a testcase to the PromQL unit tests that has mixed order of floats vs native histograms. Signed-off-by: György Krajcsovits <[email protected]>
1 parent 7876c57 commit b48bc9d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

promql/promqltest/testdata/native_histograms.test

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1373,3 +1373,19 @@ eval instant at 1m histogram_fraction(-Inf, +Inf, histogram_nan)
13731373
expect info msg: PromQL info: input to histogram_fraction has NaN observations, which are excluded from all fractions for metric name "histogram_nan"
13741374
{case="100% NaNs"} 0.0
13751375
{case="20% NaNs"} 0.8
1376+
1377+
clear
1378+
1379+
# Regression test for:
1380+
# https://github.com/prometheus/prometheus/issues/14172
1381+
# https://github.com/prometheus/prometheus/issues/15177
1382+
load 1m
1383+
mixed_metric1 1 2 3 {{schema:0 sum:5 count:4 buckets:[1 2 1]}} {{schema:0 sum:8 count:6 buckets:[1 4 1]}} 4 5 {{schema:0 sum:18 count:10 buckets:[3 4 3]}}
1384+
mixed_metric2 1 2 3 {{schema:0 sum:5 count:4 buckets:[1 2 1]}} {{schema:0 sum:8 count:6 buckets:[1 4 1]}}
1385+
1386+
# The order of the float vs native histograms is preserved
1387+
eval range from 0 to 8m step 1m mixed_metric1
1388+
mixed_metric1{} 1 2 3 {{count:4 sum:5 buckets:[1 2 1]}} {{count:6 sum:8 buckets:[1 4 1]}} 4 5 {{schema:0 sum:18 count:10 buckets:[3 4 3]}} {{schema:0 sum:18 count:10 buckets:[3 4 3]}}
1389+
1390+
eval range from 0 to 5m step 1m mixed_metric2
1391+
mixed_metric2 1 2 3 {{count:4 sum:5 buckets:[1 2 1]}} {{count:6 sum:8 buckets:[1 4 1]}} {{count:6 sum:8 buckets:[1 4 1]}}

0 commit comments

Comments
 (0)