From 3f5091e09ee584bebed05ab66efad66953d287d3 Mon Sep 17 00:00:00 2001 From: Friedrich Gonzalez <1517449+friedrichg@users.noreply.github.com> Date: Thu, 16 Apr 2026 22:09:07 -0700 Subject: [PATCH 1/2] Fix misplaced parentheses in WaitSumMetricsWithOptions calls e2e.WithLabelMatchers options were being passed as msgAndArgs to require.NoError instead of as options to WaitSumMetricsWithOptions, silently disabling label filtering in 5 integration test assertions. Signed-off-by: Friedrich Gonzalez <1517449+friedrichg@users.noreply.github.com> --- integration/alertmanager_test.go | 8 ++++---- integration/ruler_test.go | 8 ++++---- integration/utf8_test.go | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/integration/alertmanager_test.go b/integration/alertmanager_test.go index cbbdccdce15..2c57752d682 100644 --- a/integration/alertmanager_test.go +++ b/integration/alertmanager_test.go @@ -95,12 +95,12 @@ func TestAlertmanagerWithUserIndexUpdater(t *testing.T) { require.NoError(t, s.StartAndWaitReady(am)) // To make sure user index file is updated/scanned - require.NoError(t, am.WaitSumMetricsWithOptions(e2e.Greater(float64(0)), []string{"cortex_user_index_last_successful_update_timestamp_seconds"}), + require.NoError(t, am.WaitSumMetricsWithOptions(e2e.Greater(float64(0)), []string{"cortex_user_index_last_successful_update_timestamp_seconds"}, e2e.WithLabelMatchers(labels.MustNewMatcher(labels.MatchEqual, "component", "alertmanager")), - ) - require.NoError(t, am.WaitSumMetricsWithOptions(e2e.GreaterOrEqual(float64(1)), []string{"cortex_user_index_scan_succeeded_total"}), + )) + require.NoError(t, am.WaitSumMetricsWithOptions(e2e.GreaterOrEqual(float64(1)), []string{"cortex_user_index_scan_succeeded_total"}, e2e.WithLabelMatchers(labels.MustNewMatcher(labels.MatchEqual, "component", "alertmanager")), - ) + )) } func TestAlertmanagerStoreAPI(t *testing.T) { diff --git a/integration/ruler_test.go b/integration/ruler_test.go index 446f9cfade2..774a3bfb6b2 100644 --- a/integration/ruler_test.go +++ b/integration/ruler_test.go @@ -192,13 +192,13 @@ func TestRulerWithUserIndexUpdater(t *testing.T) { require.NoError(t, c.SetRuleGroup(ruleGroup, ns)) // To make sure user index file is updated/scanned - require.NoError(t, ruler.WaitSumMetricsWithOptions(e2e.Greater(float64(0)), []string{"cortex_user_index_last_successful_update_timestamp_seconds"}), + require.NoError(t, ruler.WaitSumMetricsWithOptions(e2e.Greater(float64(0)), []string{"cortex_user_index_last_successful_update_timestamp_seconds"}, e2e.WithLabelMatchers(labels.MustNewMatcher(labels.MatchEqual, "component", "ruler")), - ) + )) - require.NoError(t, ruler.WaitSumMetricsWithOptions(e2e.GreaterOrEqual(float64(1)), []string{"cortex_user_index_scan_succeeded_total"}), + require.NoError(t, ruler.WaitSumMetricsWithOptions(e2e.GreaterOrEqual(float64(1)), []string{"cortex_user_index_scan_succeeded_total"}, e2e.WithLabelMatchers(labels.MustNewMatcher(labels.MatchEqual, "component", "ruler")), - ) + )) } func TestRulerAPISingleBinary(t *testing.T) { diff --git a/integration/utf8_test.go b/integration/utf8_test.go index 0863b05f030..ae7dad07b59 100644 --- a/integration/utf8_test.go +++ b/integration/utf8_test.go @@ -164,7 +164,7 @@ overrides: err = c.SetRuleGroup(ruleGroup, "namespace") require.NoError(t, err) - require.NoError(t, cortex.WaitSumMetricsWithOptions(e2e.Equals(1), []string{"cortex_ruler_managers_total"}), e2e.WithLabelMatchers(labels.MustNewMatcher(labels.MatchEqual, "user", "user-1"))) + require.NoError(t, cortex.WaitSumMetricsWithOptions(e2e.Equals(1), []string{"cortex_ruler_managers_total"}, e2e.WithLabelMatchers(labels.MustNewMatcher(labels.MatchEqual, "user", "user-1")))) require.NoError(t, cortex.WaitSumMetricsWithOptions(e2e.Equals(1), []string{"cortex_ruler_rule_groups_in_store"}, e2e.WithLabelMatchers( labels.MustNewMatcher(labels.MatchEqual, "user", "user-1")), e2e.WaitMissingMetrics, From 128789251c311712091ebc480c20b5ecdff4bf55 Mon Sep 17 00:00:00 2001 From: SungJin1212 Date: Fri, 17 Apr 2026 15:05:49 +0900 Subject: [PATCH 2/2] fix Test_Ruler_UTF8 Signed-off-by: SungJin1212 --- integration/utf8_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration/utf8_test.go b/integration/utf8_test.go index ae7dad07b59..a45af2f7fd0 100644 --- a/integration/utf8_test.go +++ b/integration/utf8_test.go @@ -164,7 +164,7 @@ overrides: err = c.SetRuleGroup(ruleGroup, "namespace") require.NoError(t, err) - require.NoError(t, cortex.WaitSumMetricsWithOptions(e2e.Equals(1), []string{"cortex_ruler_managers_total"}, e2e.WithLabelMatchers(labels.MustNewMatcher(labels.MatchEqual, "user", "user-1")))) + require.NoError(t, cortex.WaitSumMetrics(e2e.Equals(1), "cortex_ruler_managers_total")) require.NoError(t, cortex.WaitSumMetricsWithOptions(e2e.Equals(1), []string{"cortex_ruler_rule_groups_in_store"}, e2e.WithLabelMatchers( labels.MustNewMatcher(labels.MatchEqual, "user", "user-1")), e2e.WaitMissingMetrics,