Skip to content

WIP test increase intervals for image policy update event buffers#31031

Draft
QiWang19 wants to merge 1 commit intoopenshift:mainfrom
QiWang19:fix-image-policy-intervals-cherrypick
Draft

WIP test increase intervals for image policy update event buffers#31031
QiWang19 wants to merge 1 commit intoopenshift:mainfrom
QiWang19:fix-image-policy-intervals-cherrypick

Conversation

@QiWang19
Copy link
Copy Markdown
Member

@QiWang19 QiWang19 commented Apr 17, 2026

Only extend the "To" field to +30 minutes for AddSigtermProtection
and RemoveSigtermProtection event matchers, while keeping the "From"
field at ±30 seconds. This avoids unnecessarily long time windows
before the test run while still allowing for the MCP rollout duration
which can take upwards of 30 minutes.

Summary by CodeRabbit

  • Bug Fixes
    • Extended the event detection window to improve accuracy when identifying specific monitoring patterns and intervals.

Only extend the "To" field to +30 minutes for AddSigtermProtection
    and RemoveSigtermProtection event matchers, while keeping the "From"
    field at ±30 seconds. This avoids unnecessarily long time windows
    before the test run while still allowing for the MCP rollout duration
    which can take upwards of 30 minutes.

Signed-off-by: Peter Hunt <pehunt@redhat.com>
Signed-off-by: Qi Wang <qiwan@redhat.com>
@openshift-merge-bot
Copy link
Copy Markdown
Contributor

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 openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 17, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 17, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 17, 2026

Walkthrough

Three interval-adjustment loops in duplicated_event_patterns.go were updated to extend the To timestamp adjustment from 30 seconds to 30 minutes, while From timestamp adjustments remain at -30 seconds. Blank lines were added after interval filter closures for formatting.

Changes

Cohort / File(s) Summary
Interval Window Extension
pkg/monitortestlibrary/pathologicaleventlibrary/duplicated_event_patterns.go
Updated To timestamp adjustments in three functions (configDriftMonitorStoppedIntervals, AddSigtermProtectionIntervals, RemoveSigtermProtectionIntervals) from time.Second * 30 to time.Minute * 30, while keeping From adjustments at time.Second * -30. Added formatting blank lines.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 9 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (9 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'WIP test increase intervals for image policy update event buffers' is directly related to the main change—increasing time intervals for event buffers in the test library.
Stable And Deterministic Test Names ✅ Passed This check is not applicable to the provided pull request context. The modified file is a library containing event matcher configurations and utility functions, not Ginkgo test code.
Test Structure And Quality ✅ Passed The custom check for Ginkgo test code quality is not applicable to this pull request. The modified file duplicated_event_patterns.go is production code, not Ginkgo test code.
Microshift Test Compatibility ✅ Passed PR modifies time intervals in event matcher helper functions, not Ginkgo e2e tests, so the check is not applicable.
Single Node Openshift (Sno) Test Compatibility ✅ Passed File contains no Ginkgo e2e test definitions; only utility functions for event matcher interval adjustments.
Topology-Aware Scheduling Compatibility ✅ Passed This PR modifies only a test utility library file adjusting time intervals for event pattern monitoring; it contains no deployment manifests, operator code, controllers, or any Kubernetes scheduling constraints.
Ote Binary Stdout Contract ✅ Passed Pull request contains only timestamp arithmetic adjustments in regular helper functions with no stdout writes of any kind.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The pull request does not add any new Ginkgo e2e tests; it only adjusts time intervals in helper functions within a utility library.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

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

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

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 17, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: QiWang19
Once this PR has been reviewed and has the lgtm label, please assign dgoodwin for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@QiWang19
Copy link
Copy Markdown
Member Author

/payload-job periodic-ci-openshift-release-main-ci-5.0-e2e-azure-ovn-techpreview-serial

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 17, 2026

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

  • periodic-ci-openshift-release-main-ci-5.0-e2e-azure-ovn-techpreview-serial

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/9cdbcdc0-3aad-11f1-88e0-eb078fc32a0d-0

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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@pkg/monitortestlibrary/pathologicaleventlibrary/duplicated_event_patterns.go`:
- Around line 1275-1278: The loop that expands
configDriftMonitorStoppedIntervals is applying the +30m and -30s window to all
ConfigDriftMonitorStopped entries but the PR should only extend windows for
AddSigtermProtection and RemoveSigtermProtection; update the code in
duplicated_event_patterns.go so you no longer unconditionally modify
configDriftMonitorStoppedIntervals (variable name) — either remove this loop or
guard it to only adjust entries whose associated pattern/type equals
AddSigtermProtection or RemoveSigtermProtection (use the same identifying field
or slice index logic used where those patterns are created), leaving all other
ConfigDriftMonitorStopped intervals unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 58815797-7481-40af-be67-a5b515fbd798

📥 Commits

Reviewing files that changed from the base of the PR and between e08a8b4 and 87adf77.

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

Comment on lines 1275 to 1278
for i := range configDriftMonitorStoppedIntervals {
configDriftMonitorStoppedIntervals[i].To = configDriftMonitorStoppedIntervals[i].To.Add(time.Second * 30)
configDriftMonitorStoppedIntervals[i].To = configDriftMonitorStoppedIntervals[i].To.Add(time.Minute * 30)
configDriftMonitorStoppedIntervals[i].From = configDriftMonitorStoppedIntervals[i].From.Add(time.Second * -30)
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

ConfigDrift window expansion looks unintended for this PR scope.

Line 1276 also expands ConfigDriftMonitorStopped to +30m, but the PR objective says only AddSigtermProtection and RemoveSigtermProtection should get that extension. This broadens suppression behavior beyond the stated intent.

Suggested scope-aligned fix
 for i := range configDriftMonitorStoppedIntervals {
-    configDriftMonitorStoppedIntervals[i].To = configDriftMonitorStoppedIntervals[i].To.Add(time.Minute * 30)
+    configDriftMonitorStoppedIntervals[i].To = configDriftMonitorStoppedIntervals[i].To.Add(time.Second * 30)
     configDriftMonitorStoppedIntervals[i].From = configDriftMonitorStoppedIntervals[i].From.Add(time.Second * -30)
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
for i := range configDriftMonitorStoppedIntervals {
configDriftMonitorStoppedIntervals[i].To = configDriftMonitorStoppedIntervals[i].To.Add(time.Second * 30)
configDriftMonitorStoppedIntervals[i].To = configDriftMonitorStoppedIntervals[i].To.Add(time.Minute * 30)
configDriftMonitorStoppedIntervals[i].From = configDriftMonitorStoppedIntervals[i].From.Add(time.Second * -30)
}
for i := range configDriftMonitorStoppedIntervals {
configDriftMonitorStoppedIntervals[i].To = configDriftMonitorStoppedIntervals[i].To.Add(time.Second * 30)
configDriftMonitorStoppedIntervals[i].From = configDriftMonitorStoppedIntervals[i].From.Add(time.Second * -30)
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/monitortestlibrary/pathologicaleventlibrary/duplicated_event_patterns.go`
around lines 1275 - 1278, The loop that expands
configDriftMonitorStoppedIntervals is applying the +30m and -30s window to all
ConfigDriftMonitorStopped entries but the PR should only extend windows for
AddSigtermProtection and RemoveSigtermProtection; update the code in
duplicated_event_patterns.go so you no longer unconditionally modify
configDriftMonitorStoppedIntervals (variable name) — either remove this loop or
guard it to only adjust entries whose associated pattern/type equals
AddSigtermProtection or RemoveSigtermProtection (use the same identifying field
or slice index logic used where those patterns are created), leaving all other
ConfigDriftMonitorStopped intervals unchanged.

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

Labels

do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants