From ceed487f121c00c31e36dc0247657167c30c93c1 Mon Sep 17 00:00:00 2001 From: Jeremy Poulin Date: Wed, 1 Apr 2026 12:06:05 -0400 Subject: [PATCH] OCPBUGS-81340: openshift-tests: allow duplicate pacemaker status collector CronJob events cluster-etcd-operator runs a short-interval CronJob (pacemaker-status-collector) in openshift-etcd-operator. kube-controller-manager's cronjob-controller emits SuccessfulCreate and SawCompletedJob on the CronJob involvedObject; long runs can exceed the duplicated-event threshold. Allow those repeats via PacemakerStatusCollectorCronJobEvents. SuccessfulDelete churn is addressed on the CEO side via Job TTL/history (OCPBUGS-81340). Made-with: Cursor --- .../duplicated_event_patterns.go | 14 ++++++++++++++ .../duplicated_events_test.go | 12 ++++++++++++ 2 files changed, 26 insertions(+) diff --git a/pkg/monitortestlibrary/pathologicaleventlibrary/duplicated_event_patterns.go b/pkg/monitortestlibrary/pathologicaleventlibrary/duplicated_event_patterns.go index 82ada8290622..ef9f944a8e04 100644 --- a/pkg/monitortestlibrary/pathologicaleventlibrary/duplicated_event_patterns.go +++ b/pkg/monitortestlibrary/pathologicaleventlibrary/duplicated_event_patterns.go @@ -537,6 +537,20 @@ func NewUniversalPathologicalEventMatchers(kubeConfig *rest.Config, finalInterva twoNodeEtcdEndpointsMatcher := newTwoNodeEtcdEndpointsConfigMissingEventMatcher(finalIntervals) registry.AddPathologicalEventMatcherOrDie(twoNodeEtcdEndpointsMatcher) + // cluster-etcd-operator (TNF): the pacemaker status collector CronJob runs on a short schedule; the + // kube-controller-manager cronjob-controller emits SuccessfulCreate and SawCompletedJob on the CronJob + // InvolvedObject. Long openshift-tests runs can exceed the duplicate-event threshold. + // SuccessfulDelete churn is reduced by CEO Job TTL / history tuning (see OCPBUGS-81340). + registry.AddPathologicalEventMatcherOrDie(&SimplePathologicalEventMatcher{ + name: "PacemakerStatusCollectorCronJobEvents", + locatorKeyRegexes: map[monitorapi.LocatorKey]*regexp.Regexp{ + monitorapi.LocatorNamespaceKey: regexp.MustCompile(`^openshift-etcd-operator$`), + monitorapi.LocatorKey("cronjob"): regexp.MustCompile(`^pacemaker-status-collector$`), + }, + messageReasonRegex: regexp.MustCompile(`^(SuccessfulCreate|SawCompletedJob)$`), + jira: "https://issues.redhat.com/browse/OCPBUGS-81340", + }) + newConfigDriftMonitorStoppedTooOftenEventMatcher := newConfigDriftMonitorStoppedTooOftenEventMatcher(finalIntervals) registry.AddPathologicalEventMatcherOrDie(newConfigDriftMonitorStoppedTooOftenEventMatcher) diff --git a/pkg/monitortestlibrary/pathologicaleventlibrary/duplicated_events_test.go b/pkg/monitortestlibrary/pathologicaleventlibrary/duplicated_events_test.go index d19f533add8b..7b6626f3f0bf 100644 --- a/pkg/monitortestlibrary/pathologicaleventlibrary/duplicated_events_test.go +++ b/pkg/monitortestlibrary/pathologicaleventlibrary/duplicated_events_test.go @@ -211,6 +211,18 @@ func TestAllowedRepeatedEvents(t *testing.T) { Reason("MultipleVersions").Build(), expectedAllowName: "OperatorMultipleVersions", }, + { + name: "pacemaker status collector cronjob successful create (KCM cronjob-controller)", + locator: monitorapi.Locator{ + Keys: map[monitorapi.LocatorKey]string{ + monitorapi.LocatorNamespaceKey: "openshift-etcd-operator", + monitorapi.LocatorKey("cronjob"): "pacemaker-status-collector", + }, + }, + msg: monitorapi.NewMessage().HumanMessage("Created job pacemaker-status-collector-29035215"). + Reason("SuccessfulCreate").Build(), + expectedAllowName: "PacemakerStatusCollectorCronJobEvents", + }, } for _, test := range tests { registry := NewUpgradePathologicalEventMatchers(nil, nil)