Skip to content

fix(java): Stabilize async consumer group test#3697

Open
ryerraguntla wants to merge 2 commits into
apache:masterfrom
ryerraguntla:fix(java-sdk)/3641-flaky-async-consumer-groups
Open

fix(java): Stabilize async consumer group test#3697
ryerraguntla wants to merge 2 commits into
apache:masterfrom
ryerraguntla:fix(java-sdk)/3641-flaky-async-consumer-groups

Conversation

@ryerraguntla

Copy link
Copy Markdown
Contributor

Fixes flakiness in the Java SDK async consumer-group integration test for concurrent join/leave operations. The change adds bounded retry handling for transient not-found errors and waits for the consumer-group membership count to converge before asserting, making the test more stable without changing its intent.

Handle transient IggyResourceNotFoundException during concurrent join/leave operations in AsyncConsumerGroupsTest. This adds bounded retry/backoff helpers and waits for the expected member count before asserting, reducing flakiness from eventually consistent consumer-group state.

Which issue does this PR address?

Closes # 3641
Relates to # pr=3515

Rationale

To address the flaky java tests.

What changed?

This PR stabilizes a flaky Java SDK integration test covering concurrent consumer-group join and leave operations.

The test previously asserted consumer-group state immediately after concurrent operations completed. In some runs, transient IggyResourceNotFoundException errors or short propagation delays caused intermittent failures even though the underlying behavior was correct.

Changes in this PR
add retry handling around concurrent joinConsumerGroup calls
add retry handling around concurrent leaveConsumerGroup calls
retry only for transient IggyResourceNotFoundException cases
wait until the consumer group reaches the expected member count before asserting
extract shared helper methods for retry and polling behavior
add reusable timeout and backoff constants for transient-state handling
Why
Concurrent async operations can briefly observe unstable or not-yet-visible consumer-group state. This PR makes the test robust to those short-lived conditions while preserving the original behavior being verified.

Impact
improves reliability of the Java SDK integration test suite
reduces intermittent failures in consumer-group concurrency coverage
limits scope to test code only
Reviewer-focused summary

Primary goal: eliminate flaky failures in AsyncConsumerGroupsTest
Approach: add bounded retry logic for transient not-found errors and poll for expected membership state
Scope: test-only change in the Java SDK
Risk: low, since production code is unchanged
Behavioral effect: assertions are now based on eventual stable state rather than immediate visibility after concurrent operations

Local Execution

  • Passed
  • Pre-commit hooks ran

AI Usage

If AI tools were used, please answer:

  1. Which tools? Claude
  2. Scope of usage? generated functions and implementation)
  3. How did you verify the generated code works correctly? Manually verified
  4. Can you explain every line of the code if asked? yes

Handle transient `IggyResourceNotFoundException` during concurrent join/leave operations in `AsyncConsumerGroupsTest`. This adds bounded retry/backoff helpers and waits for the expected member count before asserting, reducing flakiness from eventually consistent consumer-group state.
@github-actions

Copy link
Copy Markdown

Thanks for the PR. It is labeled S-waiting-on-review and queued for review.

Slash commands (own line, regular comment) move it around the queue:

  • /ready - back to S-waiting-on-review after addressing feedback
  • /author - flip to S-waiting-on-author while you finish changes
  • /request-review @user-or-team - request a reviewer

See CONTRIBUTING.md for details.

@github-actions github-actions Bot added the S-waiting-on-review PR is waiting on a reviewer label Jul 18, 2026
@ryerraguntla ryerraguntla changed the title fix(java-sdk): Stabilize async consumer group test fix(java): Stabilize async consumer group test Jul 18, 2026
@ryerraguntla

Copy link
Copy Markdown
Contributor Author

/ready

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review PR is waiting on a reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant