apache / apache/iggy

Flaky Java SDK test: AsyncConsumerGroupsTest.shouldHandleConcurrentJoinAndLeaveOperations fails with IggyResourceNotFoundException in CI

Open
#3,641 0 comments 0 reactions 1 assignee Claimed by @ryerraguntla View on GitHub
bug CI/CD
Dominant language
Rust
Stars
4.9k
Forks
432
Avg merge
2d 10h
Merged PRs (30d)
173

Description

### Bug description

The pre-merge workflow is failing due to a flaky Java SDK test in PR #3515.

Failing run/job:

Run: https://github.com/apache/iggy/actions/runs/28737059115?pr=3515
Job: https://github.com/apache/iggy/actions/runs/28737059115/job/85213039410?pr=3515
Observed failure in logs:

AsyncConsumerGroupsTest > shouldHandleConcurrentJoinAndLeaveOperations() FAILED
java.util.concurrent.ExecutionException at AsyncConsumerGroupsTest.java:345
Caused by: org.apache.iggy.exception.IggyResourceNotFoundException at IggyServerException.java:169
Test summary: 1032 tests completed, 1 failed, 4 skipped
Why this matters
This failure blocks pre-merge CI and appears to be a race/flakiness issue in concurrent join/leave consumer group operations in Java SDK tests.

Expected behavior
shouldHandleConcurrentJoinAndLeaveOperations should pass deterministically under CI load and timing variance.

Actual behavior
During concurrent operations, the test intermittently sees IggyResourceNotFoundException, causing the test task to fail.

Proposed fix
Harden the test against transient race windows / eventual consistency:

Add synchronization to ensure all concurrent tasks are started and completed before final assertions.
Wrap transient IggyResourceNotFoundException in bounded retry during concurrent phase.
Replace immediate final assertions with short bounded polling until state stabilizes.
Keep strict failure for non-transient exceptions.
Acceptance criteria
Java SDK test suite passes consistently in CI for this scenario.
AsyncConsumerGroupsTest.shouldHandleConcurrentJoinAndLeaveOperations no longer flakes.
No regression in consumer group join/leave behavior.
Pre-merge workflow passes for affected PRs.
Scope
foreign/java/java-sdk tests (primarily AsyncConsumerGroupsTest)
If needed, evaluate server-side consistency assumptions only if test hardening is insufficient.

### Affected area / component

CI / build / tooling

### Deployment

None

### Versions

_No response_

### Hardware / environment

_No response_

### Sample code

_No response_

### Logs

> Task :iggy:test

AsyncConsumerGroupsTest > shouldHandleConcurrentJoinAndLeaveOperations() FAILED
java.util.concurrent.ExecutionException at AsyncConsumerGroupsTest.java:345
Caused by: org.apache.iggy.exception.IggyResourceNotFoundException at IggyServerException.java:169

### Iggy server config

_No response_

### Reproduction

Its a flaky failure.

Run: https://github.com/apache/iggy/actions/runs/28737059115?pr=3515
Job: https://github.com/apache/iggy/actions/runs/28737059115/job/85213039410?pr=3515

### Contribution

- [x] I'm willing to submit a pull request to fix this bug

### Good first issue

- [ ] I think this could be a good first issue for a new contributor

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.