diff --git a/pkg/monitortestlibrary/pathologicaleventlibrary/duplicated_event_patterns.go b/pkg/monitortestlibrary/pathologicaleventlibrary/duplicated_event_patterns.go index 53c4f42edbc6..dba3218f18d5 100644 --- a/pkg/monitortestlibrary/pathologicaleventlibrary/duplicated_event_patterns.go +++ b/pkg/monitortestlibrary/pathologicaleventlibrary/duplicated_event_patterns.go @@ -445,19 +445,6 @@ func NewUniversalPathologicalEventMatchers(kubeConfig *rest.Config, finalInterva neverAllow: true, }) - // Repeating events about pod creation are expected for snapshot options tests in vsphere csi driver. - // The tests change clusterCSIDriver object and have to rollout new pods to load new configuration. - registry.AddPathologicalEventMatcherOrDie(&SimplePathologicalEventMatcher{ - name: "VsphereConfigurationTestsRollOutTooOften", - locatorKeyRegexes: map[monitorapi.LocatorKey]*regexp.Regexp{ - monitorapi.LocatorNamespaceKey: regexp.MustCompile(`^openshift-cluster-csi-drivers$`), - monitorapi.LocatorE2ETestKey: regexp.MustCompile(`.*snapshot options in clusterCSIDriver.*`), - }, - messageReasonRegex: regexp.MustCompile(`(^SuccessfulCreate$|^SuccessfulDelete$)`), - messageHumanRegex: regexp.MustCompile(`(^Created pod.*vmware-vsphere-csi-driver.*|^Deleted pod.*vmware-vsphere-csi-driver.*)`), - jira: "https://issues.redhat.com/browse/OCPBUGS-42610", - }) - registry.AddPathologicalEventMatcherOrDie(AllowBackOffRestartingFailedContainer) registry.AddPathologicalEventMatcherOrDie(AllowOVNReadiness) @@ -497,6 +484,9 @@ func NewUniversalPathologicalEventMatchers(kubeConfig *rest.Config, finalInterva registry.AddPathologicalEventMatcherOrDie(singleNodeConnectionRefusedMatcher) registry.AddPathologicalEventMatcherOrDie(singleNodeKubeAPIServerProgressingMatcher) + vsphereConfigurationTestsRollOutTooOftenMatcher := newVsphereConfigurationTestsRollOutTooOftenEventMatcher(finalIntervals) + registry.AddPathologicalEventMatcherOrDie(vsphereConfigurationTestsRollOutTooOftenMatcher) + return registry } @@ -948,6 +938,32 @@ func newTopologyAwareHintsDisabledDuringTaintTestsPathologicalEventMatcher(final return matcher } +// Repeating events about pod creation are expected for snapshot options tests in vsphere csi driver. +// The tests change clusterCSIDriver object and have to rollout new pods to load new configuration. +func newVsphereConfigurationTestsRollOutTooOftenEventMatcher(finalIntervals monitorapi.Intervals) EventMatcher { + configurationTestIntervals := finalIntervals.Filter(func(eventInterval monitorapi.Interval) bool { + return eventInterval.Source == monitorapi.SourceE2ETest && + strings.Contains(eventInterval.Locator.Keys[monitorapi.LocatorE2ETestKey], "snapshot options in clusterCSIDriver") + }) + for i := range configurationTestIntervals { + configurationTestIntervals[i].To = configurationTestIntervals[i].To.Add(time.Minute * 10) + configurationTestIntervals[i].From = configurationTestIntervals[i].From.Add(time.Minute * -10) + } + + return &OverlapOtherIntervalsPathologicalEventMatcher{ + delegate: &SimplePathologicalEventMatcher{ + name: "VsphereConfigurationTestsRollOutTooOften", + locatorKeyRegexes: map[monitorapi.LocatorKey]*regexp.Regexp{ + monitorapi.LocatorNamespaceKey: regexp.MustCompile(`^openshift-cluster-csi-drivers$`), + }, + messageReasonRegex: regexp.MustCompile(`(^SuccessfulCreate$|^SuccessfulDelete$)`), + messageHumanRegex: regexp.MustCompile(`(Created pod.*vmware-vsphere-csi-driver.*|Deleted pod.*vmware-vsphere-csi-driver.*)`), + jira: "https://issues.redhat.com/browse/OCPBUGS-42610", + }, + allowIfWithinIntervals: configurationTestIntervals, + } +} + // Ignore connection refused events during OCP APIServer or OAuth APIServer being down func newSingleNodeConnectionRefusedEventMatcher(finalIntervals monitorapi.Intervals) EventMatcher { const (