Skip to content

test: failing tests for superseding event not resetting retry counter#3478

Open
SamBarker wants to merge 3 commits into
operator-framework:mainfrom
SamBarker:failing-test/superseding-event-retry-reset
Open

test: failing tests for superseding event not resetting retry counter#3478
SamBarker wants to merge 3 commits into
operator-framework:mainfrom
SamBarker:failing-test/superseding-event-retry-reset

Conversation

@SamBarker

Copy link
Copy Markdown
Contributor

Summary

  • Adds two @Disabled failing tests to EventProcessorTest demonstrating that superseding events during a retry cycle do not reset the retry counter
  • newEventShouldBeRetryableAfterPriorRetryExhaustion — unit-level: a new event after retry exhaustion inherits the exhausted counter and gets zero retry budget
  • supersedingEventConsumedDuringRetryShouldNotPermanentlyStallReconciliation — uses a real TimerEventSource and CountDownLatch to reproduce the end-to-end scenario where a superseding event is consumed mid-retry, its re-execution also fails, and the resource is permanently stuck

Test plan

  • Both new tests fail when @Disabled is removed (demonstrating the bug)
  • All existing tests pass with the new tests disabled

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>

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

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 @Disabled tests in EventProcessorTest reproducing retry counter/budget not being reset across superseding/new events.
  • Added a test-only ControllerConfiguration helper that returns Optional.empty() for maxReconciliationInterval() 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);
SamBarker added 2 commits July 8, 2026 16:11
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>
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