test: fix flaky additionalFinalizer in TriggerReconcilerOnAllEventIT#3434
Open
csviri wants to merge 2 commits into
Open
test: fix flaky additionalFinalizer in TriggerReconcilerOnAllEventIT#3434csviri wants to merge 2 commits into
csviri wants to merge 2 commits into
Conversation
9844656 to
734e997
Compare
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>
734e997 to
0ff843c
Compare
Contributor
There was a problem hiding this comment.
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
Awaitilitywait that blocks until both the additional finalizer and the operator finalizer are present before issuing the delete, ensuring the baseline event count is deterministic.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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