From c3da46047447d9541c0b0d90866c132049d14d69 Mon Sep 17 00:00:00 2001 From: beorn7 Date: Tue, 10 Jun 2025 21:44:05 +0200 Subject: [PATCH 1/2] promql: Deactivate three failing tests for the time being These tests fail on darwin/arm64. One is expected, because the test demonstrates the limits of the numerical accuracy of our methods, and different inaccurate outcomes on different hardware are expected. The other two are mysterious at the moment, see https://github.com/prometheus/prometheus/issues/16714 for detailed discussion and debugging. Signed-off-by: beorn7 --- promql/promqltest/testdata/aggregators.test | 6 ++++-- promql/promqltest/testdata/functions.test | 13 ++++++++----- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/promql/promqltest/testdata/aggregators.test b/promql/promqltest/testdata/aggregators.test index b8ebdc55c6..7062d37f05 100644 --- a/promql/promqltest/testdata/aggregators.test +++ b/promql/promqltest/testdata/aggregators.test @@ -593,8 +593,10 @@ eval instant at 1m avg(data{test="big"}) eval instant at 1m avg(data{test="-big"}) {} -9.988465674311579e+307 -eval instant at 1m avg(data{test="bigzero"}) - {} 0 +# This test fails on darwin/arm64. +# Deactivated until issue #16714 is fixed. +# eval instant at 1m avg(data{test="bigzero"}) +# {} 0 # If NaN is in the mix, the result is NaN. eval instant at 1m avg(data) diff --git a/promql/promqltest/testdata/functions.test b/promql/promqltest/testdata/functions.test index beb216b93c..c39b387f0c 100644 --- a/promql/promqltest/testdata/functions.test +++ b/promql/promqltest/testdata/functions.test @@ -1010,8 +1010,10 @@ load 10s eval instant at 1m sum_over_time(metric[2m]) {} 2 -eval instant at 1m avg_over_time(metric[2m]) - {} 0.5 +# This test fails on darwin/arm64. +# Deactivated until issue #16714 is fixed. +# eval instant at 1m avg_over_time(metric[2m]) +# {} 0.5 # More tests for extreme values. clear @@ -1082,9 +1084,10 @@ load 5s # needed to do something like sorting the values (which is hard given # how the PromQL engine works). The question is how practically # relevant this scenario is. -eval instant at 55s avg_over_time(metric11[1m]) - {} -1.881783551706252e+203 -# {} -44.848083237000004 <- This is the correct value. +# eval instant at 55s avg_over_time(metric11[1m]) +# {} -44.848083237000004 <- This is the correct value. +# {} -1.881783551706252e+203 <- This is the relust on linux/amd64. +# {} 2.303079268822384e+202 <- This is the relust on darwin/arm64. # Test per-series aggregation on dense samples. clear From 68b1bcc6488ba0f4fd30b143d05496c4954998f9 Mon Sep 17 00:00:00 2001 From: beorn7 Date: Tue, 10 Jun 2025 22:06:04 +0200 Subject: [PATCH 2/2] promql: typo fix in comment Signed-off-by: beorn7 --- promql/functions.go | 2 +- promql/promqltest/testdata/functions.test | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/promql/functions.go b/promql/functions.go index 7e5205844a..4eb6dfb65e 100644 --- a/promql/functions.go +++ b/promql/functions.go @@ -682,7 +682,7 @@ func funcAvgOverTime(vals []parser.Value, args parser.Expressions, enh *EvalNode // https://stackoverflow.com/questions/61665473/is-it-beneficial-for-precision-to-calculate-the-incremental-mean-average // Additional note: For even better numerical accuracy, we would need to // process the values in a particular order. For avg_over_time, that - // would be more or less feasible, but it would be more expensivo, and + // would be more or less feasible, but it would be more expensive, and // it would also be much harder for the avg aggregator, given how the // PromQL engine works. if len(firstSeries.Floats) == 0 { diff --git a/promql/promqltest/testdata/functions.test b/promql/promqltest/testdata/functions.test index c39b387f0c..1d7b7ed2d4 100644 --- a/promql/promqltest/testdata/functions.test +++ b/promql/promqltest/testdata/functions.test @@ -1086,8 +1086,8 @@ load 5s # relevant this scenario is. # eval instant at 55s avg_over_time(metric11[1m]) # {} -44.848083237000004 <- This is the correct value. -# {} -1.881783551706252e+203 <- This is the relust on linux/amd64. -# {} 2.303079268822384e+202 <- This is the relust on darwin/arm64. +# {} -1.881783551706252e+203 <- This is the result on linux/amd64. +# {} 2.303079268822384e+202 <- This is the result on darwin/arm64. # Test per-series aggregation on dense samples. clear