Skip to content

test: fix flaky TriggerReconcilerOnAllEventIT.additionalEventDuringRetryOnDeleteEvent - #3634

Merged
csviri merged 1 commit into
operator-framework:mainfrom
csviri:flaky-triggel-all
Sep 28, 2026
Merged

csviri merged 1 commit into
operator-framework:mainfrom
csviri:flaky-triggel-all

Conversation

@csviri

@csviri csviri commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

The test assumed at least 3 reconciliations happen before the reconciler
starts waiting on the first retry. If the delete event arrives before the
first reconciliation reads the resource, the finalizer-adding reconciliation
is skipped, the reconciler starts waiting at count 2, and the test and the
reconciler block on each other until timeout.

Wait for the reconciler to be waiting and snapshot the event count then
instead.

Summary by CodeRabbit

  • Tests
    • Updated test synchronization for delete-event retries to wait for the reconciler to reach a stable waiting state before checking the event count.

…tryOnDeleteEvent

The test assumed at least 3 reconciliations happen before the reconciler
starts waiting on the first retry. If the delete event arrives before the
first reconciliation reads the resource, the finalizer-adding reconciliation
is skipped, the reconciler starts waiting at count 2, and the test and the
reconciler block on each other until timeout.

Wait for the reconciler to be waiting and snapshot the event count then
instead.
Copilot AI lite review requested due to automatic review settings September 25, 2026 12:09
@openshift-ci
openshift-ci Bot requested review from metacosm and xstefank September 25, 2026 12:09
@coderabbitai

coderabbitai Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 53b24cbc-9831-461a-b7d5-06273317b03b

📥 Commits

Reviewing files that changed from the base of the PR and between 7c3ec5e and d743dae.

📒 Files selected for processing (1)
  • operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/triggerallevent/eventing/TriggerReconcilerOnAllEventIT.java

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

The retry test now waits until the reconciler is waiting before capturing the event count. Comments explain why the initial reconciliation count can vary and why the count is stable while the reconciler waits.

Changes

Retry test synchronization

Layer / File(s) Summary
Capture count after waiting
operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/triggerallevent/eventing/TriggerReconcilerOnAllEventIT.java
The test removes the fixed eventCount > 2 condition and polling delay. It waits for isWaiting() before capturing the event count. Comments describe the varying initial count and its stability during the wait.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to d743d

The test waits for the reconciler to enter its waiting state before capturing the event count. The snapshot is safe, and no actionable merge risk remains.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the test being fixed and the primary purpose of the change: resolving flaky behavior in TriggerReconcilerOnAllEventIT.additionalEventDuringRetryOnDeleteEvent.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The test synchronization fix addresses the reported flakiness without unresolved issues.

Review effort: Lite
Findings: None

What changed in this PR

Fixes a flaky integration test by synchronizing on the reconciler’s retry-waiting state instead of assuming a fixed reconciliation count.

Changes:

  • Waits for retry waiting before snapshotting the event count.
  • Handles deletion races deterministically.
File Description
operator-framework/​src/​test/​java/​io/​javaoperatorsdk/​operator/​baseapi/​triggerallevent/​eventing/​TriggerReconcilerOnAllEventIT.java Makes retry-event test synchronization robust.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@csviri
csviri merged commit 49eda9f into operator-framework:main Sep 28, 2026
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants