test: failing tests for superseding event not resetting retry counter#3478
Open
SamBarker wants to merge 3 commits into
Open
test: failing tests for superseding event not resetting retry counter#3478SamBarker wants to merge 3 commits into
SamBarker wants to merge 3 commits into
Conversation
A superseding event arriving during a retry cycle does not reset the retry counter. If the superseding event's re-execution also fails (e.g. because the informer cache is still stale), the retry budget from the original cycle is inherited and may already be exhausted, leaving the resource permanently un-reconciled. Two failing tests demonstrate this: 1. newEventShouldBeRetryableAfterPriorRetryExhaustion — unit-level proof that a new event after retry exhaustion inherits the exhausted counter. 2. supersedingEventConsumedDuringRetryShouldNotPermanentlyStallReconciliation — uses a real TimerEventSource and CountDownLatch to reproduce the end-to-end scenario: initial failure → timer retry (blocked by latch) → superseding event injected mid-retry → re-execution fails → retry budget exhausted → resource permanently stuck. Both tests are @disabled pending a fix. Assisted-by: Claude claude-opus-4-6 <noreply@anthropic.com> Signed-off-by: Sam Barker <sam@quadrocket.co.uk>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds disabled regression tests to document a retry-budget inheritance issue in EventProcessor when superseding events occur during a retry cycle (and when no maxReconciliationInterval fallback exists).
Changes:
- Added two
@Disabledtests inEventProcessorTestreproducing retry counter/budget not being reset across superseding/new events. - Added a test-only
ControllerConfigurationhelper that returnsOptional.empty()formaxReconciliationInterval()to isolate the failure mode.
Comment on lines
+330
to
+333
| if (count == 2) { | ||
| retryExecutionStarted.countDown(); | ||
| proceedWithRetry.await(5, TimeUnit.SECONDS); | ||
| } |
| }); | ||
|
|
||
| processor.handleEvent(new ResourceEvent(ResourceAction.UPDATED, resourceID, customResource)); | ||
| retryExecutionStarted.await(5, TimeUnit.SECONDS); |
Assisted-by: Claude claude-opus-4-6 <noreply@anthropic.com> Signed-off-by: Sam Barker <sam@quadrocket.co.uk>
Assisted-by: Claude claude-opus-4-6 <noreply@anthropic.com> Signed-off-by: Sam Barker <sam@quadrocket.co.uk>
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.
Summary
@Disabledfailing tests toEventProcessorTestdemonstrating that superseding events during a retry cycle do not reset the retry counternewEventShouldBeRetryableAfterPriorRetryExhaustion— unit-level: a new event after retry exhaustion inherits the exhausted counter and gets zero retry budgetsupersedingEventConsumedDuringRetryShouldNotPermanentlyStallReconciliation— uses a realTimerEventSourceandCountDownLatchto reproduce the end-to-end scenario where a superseding event is consumed mid-retry, its re-execution also fails, and the resource is permanently stuckTest plan
@Disabledis removed (demonstrating the bug)