Skip to content

test: fix flaky finalizer removal in TriggerReconcilerOnAllEventIT - #3543

Open
csviri wants to merge 1 commit into
operator-framework:nextfrom
csviri:all-event-flake
Open

test: fix flaky finalizer removal in TriggerReconcilerOnAllEventIT#3543
csviri wants to merge 1 commit into
operator-framework:nextfrom
csviri:all-event-flake

Conversation

@csviri

@csviri csviri commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

The event count is increased at the beginning of the reconciliation, thus
waiting for it released the test into the middle of a reconciliation that
was still about to remove the finalizer. The subsequent update then raced
with that removal and failed with a conflict.

Wait for the finalizer removal to actually land, and retry the (optimistically
locked) update with a fresh read on conflict.

The event count is increased at the beginning of the reconciliation, thus
waiting for it released the test into the middle of a reconciliation that
was still about to remove the finalizer. The subsequent update then raced
with that removal and failed with a conflict.

Wait for the finalizer removal to actually land, and retry the (optimistically
locked) update with a fresh read on conflict.
Copilot AI lite review requested due to automatic review settings August 7, 2026 11:45
@openshift-ci
openshift-ci Bot requested review from metacosm and xstefank August 7, 2026 11:45
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 4860cdbb-e80f-445b-8d4e-57b864f3ee17

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

Pull request overview

Fixes a flaky integration test around finalizer removal in TriggerReconcilerOnAllEventIT by synchronizing on the actual finalizer state (not just event count) and making the update step resilient to optimistic-lock conflicts.

Changes:

  • Waits until the reconciler’s finalizer has been removed (resource has only ADDITIONAL_FINALIZER) before proceeding.
  • Retries the finalizer-removal update step to handle resourceVersion conflicts during concurrent reconciliation.

Comment on lines +265 to +272
await()
.ignoreException(KubernetesClientException.class)
.untilAsserted(
() -> {
var res = getResource();
res.removeFinalizer(ADDITIONAL_FINALIZER);
extension.update(res);
});
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.

2 participants