Skip to content

Commit

Permalink
filter out pod events during vsphere snapshot options e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanBednar committed Dec 9, 2024
1 parent 34565b0 commit 407f4c4
Showing 1 changed file with 29 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -497,6 +484,9 @@ func NewUniversalPathologicalEventMatchers(kubeConfig *rest.Config, finalInterva
registry.AddPathologicalEventMatcherOrDie(singleNodeConnectionRefusedMatcher)
registry.AddPathologicalEventMatcherOrDie(singleNodeKubeAPIServerProgressingMatcher)

vsphereConfigurationTestsRollOutTooOftenMatcher := newVsphereConfigurationTestsRollOutTooOftenEventMatcher(finalIntervals)
registry.AddPathologicalEventMatcherOrDie(vsphereConfigurationTestsRollOutTooOftenMatcher)

return registry
}

Expand Down Expand Up @@ -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 (
Expand Down

0 comments on commit 407f4c4

Please sign in to comment.