From b6aff14cedf8a800beb2966b8b606e09729ed67d Mon Sep 17 00:00:00 2001 From: Carrie Edwards Date: Thu, 10 Jul 2025 12:59:06 -0700 Subject: [PATCH] Fix linting and flaky test Signed-off-by: Carrie Edwards --- promql/engine_test.go | 3 +++ storage/type_unit_mismatch_storage.go | 1 + 2 files changed, 4 insertions(+) diff --git a/promql/engine_test.go b/promql/engine_test.go index 7e18b764f3..3cf881b88e 100644 --- a/promql/engine_test.go +++ b/promql/engine_test.go @@ -20,6 +20,7 @@ import ( "math" "os" "path/filepath" + "slices" "sort" "strings" "sync" @@ -3758,6 +3759,8 @@ func TestTypeUnitMismatchAnnotations(t *testing.T) { require.NoError(t, res.Err) warnings, infos := res.Warnings.AsStrings(testCase.expr, 0, 0) + slices.Sort(warnings) + slices.Sort(infos) testutil.RequireEqual(t, testCase.expectedWarningAnnotations, warnings) testutil.RequireEqual(t, testCase.expectedInfoAnnotations, infos) }) diff --git a/storage/type_unit_mismatch_storage.go b/storage/type_unit_mismatch_storage.go index 87a98b09dc..8b868812e6 100644 --- a/storage/type_unit_mismatch_storage.go +++ b/storage/type_unit_mismatch_storage.go @@ -16,6 +16,7 @@ package storage import ( "context" "fmt" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/util/annotations" )