Skip to content

OCPBUGS-81340: openshift-tests: allow duplicate pacemaker status collector CronJob events#30953

Open
jaypoulz wants to merge 1 commit intoopenshift:mainfrom
jaypoulz:OCPBUGS-81340-pacemaker-status-collector-events
Open

OCPBUGS-81340: openshift-tests: allow duplicate pacemaker status collector CronJob events#30953
jaypoulz wants to merge 1 commit intoopenshift:mainfrom
jaypoulz:OCPBUGS-81340-pacemaker-status-collector-events

Conversation

@jaypoulz
Copy link
Copy Markdown
Contributor

@jaypoulz jaypoulz commented Apr 1, 2026

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

…ector 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
@openshift-ci-robot
Copy link
Copy Markdown

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: automatic mode

@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. labels Apr 1, 2026
@openshift-ci-robot
Copy link
Copy Markdown

@jaypoulz: This pull request references Jira Issue OCPBUGS-81340, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.22.0) matches configured target version for branch (4.22.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

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

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot requested review from deads2k and sjenning April 1, 2026 19:40
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 1, 2026

Walkthrough

Added a new PacemakerStatusCollectorCronJobEvents pathological event matcher for cronjob events in the openshift-etcd-operator namespace, targeting the pacemaker-status-collector job with event reasons SuccessfulCreate or SawCompletedJob. Corresponding test coverage added to verify the matcher behavior.

Changes

Cohort / File(s) Summary
Pacemaker Status Collector Event Matcher
pkg/monitortestlibrary/pathologicaleventlibrary/duplicated_event_patterns.go, pkg/monitortestlibrary/pathologicaleventlibrary/duplicated_events_test.go
Added new SimplePathologicalEventMatcher registration for pacemaker-status-collector cronjob events in openshift-etcd-operator namespace, matching SuccessfulCreate and SawCompletedJob reasons. Includes matching test case verifying allowed duplicated event behavior with reference to OCPBUGS-81340.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
pkg/monitortestlibrary/pathologicaleventlibrary/duplicated_events_test.go (1)

214-225: Add a companion test for SawCompletedJob to fully cover the matcher contract.

This case covers SuccessfulCreate, but the matcher also allows SawCompletedJob. Adding that second reason path prevents silent regressions.

Suggested test addition
 		{
 			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",
 		},
+		{
+			name: "pacemaker status collector cronjob saw completed job (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("Saw completed job: pacemaker-status-collector-29035215, condition: Complete").
+				Reason("SawCompletedJob").Build(),
+			expectedAllowName: "PacemakerStatusCollectorCronJobEvents",
+		},

As per coding guidelines, "-Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/monitortestlibrary/pathologicaleventlibrary/duplicated_events_test.go`
around lines 214 - 225, Add a companion test case for the SawCompletedJob path
to mirror the existing SuccessfulCreate case so the matcher contract is fully
covered: in duplicated_events_test.go add a new test entry (similar to the
existing "pacemaker status collector cronjob successful create ...") that uses
monitorapi.NewMessage().HumanMessage(...) with Reason("SawCompletedJob") (and an
appropriate human message like "Saw completed job
pacemaker-status-collector-29035215") and the same Locator keys, and set
expectedAllowName to "PacemakerStatusCollectorCronJobEvents"; this ensures both
SuccessfulCreate and SawCompletedJob branches of the matcher are exercised.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@pkg/monitortestlibrary/pathologicaleventlibrary/duplicated_events_test.go`:
- Around line 214-225: Add a companion test case for the SawCompletedJob path to
mirror the existing SuccessfulCreate case so the matcher contract is fully
covered: in duplicated_events_test.go add a new test entry (similar to the
existing "pacemaker status collector cronjob successful create ...") that uses
monitorapi.NewMessage().HumanMessage(...) with Reason("SawCompletedJob") (and an
appropriate human message like "Saw completed job
pacemaker-status-collector-29035215") and the same Locator keys, and set
expectedAllowName to "PacemakerStatusCollectorCronJobEvents"; this ensures both
SuccessfulCreate and SawCompletedJob branches of the matcher are exercised.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: fa467f8f-8a94-40d8-a140-e50d4d63e4dd

📥 Commits

Reviewing files that changed from the base of the PR and between d065afe and ceed487.

📒 Files selected for processing (2)
  • pkg/monitortestlibrary/pathologicaleventlibrary/duplicated_event_patterns.go
  • pkg/monitortestlibrary/pathologicaleventlibrary/duplicated_events_test.go

@openshift-ci-robot
Copy link
Copy Markdown

Scheduling required tests:
/test e2e-aws-csi
/test e2e-aws-ovn-fips
/test e2e-aws-ovn-microshift
/test e2e-aws-ovn-microshift-serial
/test e2e-aws-ovn-serial-1of2
/test e2e-aws-ovn-serial-2of2
/test e2e-gcp-csi
/test e2e-gcp-ovn
/test e2e-gcp-ovn-upgrade
/test e2e-metal-ipi-ovn-ipv6
/test e2e-vsphere-ovn
/test e2e-vsphere-ovn-upi

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 2, 2026

@jaypoulz: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-gcp-ovn-upgrade ceed487 link true /test e2e-gcp-ovn-upgrade

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@dgoodwin
Copy link
Copy Markdown
Contributor

dgoodwin commented Apr 2, 2026

On the assumption the TNF folks and the API folks are confident the cronjob event load is safe for the APIServer

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 2, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 2, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dgoodwin, jaypoulz

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 2, 2026
@eggfoobar
Copy link
Copy Markdown
Contributor

/payload-job periodic-ci-openshift-release-main-nightly-4.22-e2e-metal-ovn-two-node-fencing-techpreview

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 6, 2026

@eggfoobar: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

  • periodic-ci-openshift-release-main-nightly-4.22-e2e-metal-ovn-two-node-fencing-techpreview

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/ab4e5940-31bb-11f1-95de-32af1b721947-0

@jaypoulz
Copy link
Copy Markdown
Contributor Author

jaypoulz commented Apr 7, 2026

Still trying to pull input from the API-server team in this thread.
https://redhat-internal.slack.com/archives/CB48XQ4KZ/p1775585984841039?thread_ts=1774894017.830599&cid=CB48XQ4KZ

IMHO, we should be fine between this and the CEO tweak to reduce the job-deletion events. If the api-server team feels otherwise, we can open a follow-up issue to address based on their recommendations. My observation is, we'd still need this patch in if they say a 1 minute minimum was required (instead of 30s) because the tests will generate enough events in a 2 hour run to trigger the pathological events tracker.

@jaypoulz
Copy link
Copy Markdown
Contributor Author

jaypoulz commented Apr 7, 2026

/payload-job periodic-ci-openshift-release-main-nightly-4.22-e2e-metal-ovn-two-node-fencing-techpreview

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 7, 2026

@jaypoulz: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

  • periodic-ci-openshift-release-main-nightly-4.22-e2e-metal-ovn-two-node-fencing-techpreview

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/d3e19270-32ae-11f1-8bd9-751d3677bd9e-0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants