test: de-flake DynamicGenericEventSourceRegistrationIT#3433
Open
csviri wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR de-flakes DynamicGenericEventSourceRegistrationIT by avoiding race-prone assertions on reconciliation execution counts during a self-induced reconcile cascade, particularly after the read-after-write filtering rework in #3414.
Changes:
- Waits for the reconciliation execution count to stabilize before capturing a baseline.
- Replaces an exact “+2 executions” assertion with a lower-bound assertion after an external
ConfigMapreplace. - Strengthens the initial await by also asserting that both dynamic event sources have been registered.
Comment on lines
+93
to
101
| await() | ||
| .pollInterval(Duration.ofMillis(300)) | ||
| .untilAsserted( | ||
| () -> { | ||
| assertThat(reconciler.getNumberOfExecutions() - executions).isEqualTo(2); | ||
| var current = reconciler.getNumberOfExecutions(); | ||
| assertThat(current).isEqualTo(previous.getAndSet(current)); | ||
| }); | ||
| assertThat(reconciler.getNumberOfEventSources()).isEqualTo(2); | ||
| return reconciler.getNumberOfExecutions(); | ||
| } |
The test captured the reconcile execution count while the create-triggered reconcile cascade was still running (the first await only checked that the ConfigMap and Secret existed, not that the system had quiesced), and asserted an exact +2 executions after the external replace. The reconciler re-writes the ConfigMap/Secret on every execution, so the number of self-induced reconciles is timing-dependent, and after the read-after-write filtering rework (#3414) the reconciler's own follow-up write is filtered, so a deterministic +2 no longer holds. Wait for the execution count to stabilize before capturing the baseline, and assert only a lower bound (at least one more execution) after the replace. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
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 test captured the reconcile execution count while the create-triggered
reconcile cascade was still running (the first await only checked that the
ConfigMap and Secret existed, not that the system had quiesced), and asserted
an exact +2 executions after the external replace.
The reconciler re-writes the ConfigMap/Secret on every execution, so the number
of self-induced reconciles is timing-dependent, and after the read-after-write
filtering rework (#3414) the reconciler's own follow-up write is filtered, so a
deterministic +2 no longer holds.
Wait for the execution count to stabilize before capturing the baseline, and
assert only a lower bound (at least one more execution) after the replace.
Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com