Skip to content

test: fix flaky additionalFinalizer in TriggerReconcilerOnAllEventIT#3434

Open
csviri wants to merge 2 commits into
operator-framework:mainfrom
csviri:flaky-TriggerReconcilerOnAllEventIT
Open

test: fix flaky additionalFinalizer in TriggerReconcilerOnAllEventIT#3434
csviri wants to merge 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 from 9844656 to 734e997 Compare June 19, 2026 08: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>
@csviri csviri force-pushed the flaky-TriggerReconcilerOnAllEventIT branch 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.

Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
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