Skip to content

test: fix flaky additionalFinalizer in TriggerReconcilerOnAllEventIT#3434

Merged
csviri merged 2 commits into
operator-framework:mainfrom
csviri:flaky-TriggerReconcilerOnAllEventIT
Jun 21, 2026
Merged

test: fix flaky additionalFinalizer in TriggerReconcilerOnAllEventIT#3434
csviri merged 2 commits into
operator-framework:mainfrom
csviri:flaky-TriggerReconcilerOnAllEventIT

Conversation

@csviri

@csviri csviri commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

The phase-1 await could pass prematurely: right after create() the resource
already has exactly [ADDITIONAL_FINALIZER], before the operator adds its own
FINALIZER. This snapshotted a stale event count, so the phase-2
isEqualTo(eventCount + 1) assertion against a monotonic counter would overshoot
and time out.

Wait for the operator to add its own finalizer before deleting, so phase 1
reflects the completed add/mark-for-deletion/remove cycle and the baseline is
deterministic.

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com

Copilot AI review requested due to automatic review settings June 19, 2026 08:57
@openshift-ci openshift-ci Bot requested review from metacosm and xstefank June 19, 2026 08:57
@csviri csviri force-pushed the flaky-TriggerReconcilerOnAllEventIT branch 2 times, most recently from 734e997 to 0ff843c Compare June 19, 2026 08:58

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

This PR stabilizes an integration test by eliminating a race where the test could snapshot the reconciler’s event counter before the operator has added its own finalizer, leading to a flaky eventCount + 1 assertion.

Changes:

  • Adds an Awaitility wait that blocks until both the additional finalizer and the operator finalizer are present before issuing the delete, ensuring the baseline event count is deterministic.

csviri and others added 2 commits June 21, 2026 21:58
The phase-1 await could pass prematurely: right after create() the resource
already has exactly [ADDITIONAL_FINALIZER], before the operator adds its own
FINALIZER. This snapshotted a stale event count, so the phase-2
isEqualTo(eventCount + 1) assertion against a monotonic counter would overshoot
and time out.

Wait for the operator to add its own finalizer before deleting, so phase 1
reflects the completed add/mark-for-deletion/remove cycle and the baseline is
deterministic.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
@csviri csviri force-pushed the flaky-TriggerReconcilerOnAllEventIT branch from a6a7fc4 to bc13f81 Compare June 21, 2026 19:58
@csviri csviri merged commit 6ba110a into operator-framework:main Jun 21, 2026
1 check passed

@xstefank xstefank left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

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