Skip to content

Commit c6e9e5f

Browse files
Merge pull request #30953 from jaypoulz/OCPBUGS-81340-pacemaker-status-collector-events
OCPBUGS-81340: openshift-tests: allow duplicate pacemaker status collector CronJob events
2 parents ff6f2ef + ceed487 commit c6e9e5f

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

pkg/monitortestlibrary/pathologicaleventlibrary/duplicated_event_patterns.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,20 @@ func NewUniversalPathologicalEventMatchers(kubeConfig *rest.Config, finalInterva
537537
twoNodeEtcdEndpointsMatcher := newTwoNodeEtcdEndpointsConfigMissingEventMatcher(finalIntervals)
538538
registry.AddPathologicalEventMatcherOrDie(twoNodeEtcdEndpointsMatcher)
539539

540+
// cluster-etcd-operator (TNF): the pacemaker status collector CronJob runs on a short schedule; the
541+
// kube-controller-manager cronjob-controller emits SuccessfulCreate and SawCompletedJob on the CronJob
542+
// InvolvedObject. Long openshift-tests runs can exceed the duplicate-event threshold.
543+
// SuccessfulDelete churn is reduced by CEO Job TTL / history tuning (see OCPBUGS-81340).
544+
registry.AddPathologicalEventMatcherOrDie(&SimplePathologicalEventMatcher{
545+
name: "PacemakerStatusCollectorCronJobEvents",
546+
locatorKeyRegexes: map[monitorapi.LocatorKey]*regexp.Regexp{
547+
monitorapi.LocatorNamespaceKey: regexp.MustCompile(`^openshift-etcd-operator$`),
548+
monitorapi.LocatorKey("cronjob"): regexp.MustCompile(`^pacemaker-status-collector$`),
549+
},
550+
messageReasonRegex: regexp.MustCompile(`^(SuccessfulCreate|SawCompletedJob)$`),
551+
jira: "https://issues.redhat.com/browse/OCPBUGS-81340",
552+
})
553+
540554
newConfigDriftMonitorStoppedTooOftenEventMatcher := newConfigDriftMonitorStoppedTooOftenEventMatcher(finalIntervals)
541555
registry.AddPathologicalEventMatcherOrDie(newConfigDriftMonitorStoppedTooOftenEventMatcher)
542556

pkg/monitortestlibrary/pathologicaleventlibrary/duplicated_events_test.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,18 @@ func TestAllowedRepeatedEvents(t *testing.T) {
211211
Reason("MultipleVersions").Build(),
212212
expectedAllowName: "OperatorMultipleVersions",
213213
},
214+
{
215+
name: "pacemaker status collector cronjob successful create (KCM cronjob-controller)",
216+
locator: monitorapi.Locator{
217+
Keys: map[monitorapi.LocatorKey]string{
218+
monitorapi.LocatorNamespaceKey: "openshift-etcd-operator",
219+
monitorapi.LocatorKey("cronjob"): "pacemaker-status-collector",
220+
},
221+
},
222+
msg: monitorapi.NewMessage().HumanMessage("Created job pacemaker-status-collector-29035215").
223+
Reason("SuccessfulCreate").Build(),
224+
expectedAllowName: "PacemakerStatusCollectorCronJobEvents",
225+
},
214226
}
215227
for _, test := range tests {
216228
registry := NewUpgradePathologicalEventMatchers(nil, nil)

0 commit comments

Comments
 (0)