Skip to content

KAFKA-21069: Fix flaky consumer group authentication tests - #23430

Open
andyhuangdev wants to merge 3 commits into
apache:trunkfrom
andyhuangdev:KAFKA-21069
Open

andyhuangdev wants to merge 3 commits into
apache:trunkfrom
andyhuangdev:KAFKA-21069

Conversation

@andyhuangdev

@andyhuangdev andyhuangdev commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Description

The controller can acknowledge a SCRAM credential update before brokers apply it. Starting clients during this window can cause authentication failures and terminate the background consumer task, leaving the test waiting for a consumer group that never forms.

Wait for the credentials to appear in each broker’s cache before starting the consumer and admin client.

Testing

  • Reproduced the failure by delaying broker-side credential publication with a debugger.
  • Verified the fix with the same delay.
  • All four tests in ConsumerGroupCommandSaslAuthenticationTest pass with breakpoints disabled.

Reviewers: majialong majialoong@gmail.com

…lients

Wait for SCRAM credentials to appear in each broker's cache before starting the consumer and admin client. This prevents authentication failures when the controller acknowledges the update before brokers apply it.

Tests: Reproduced the failure by delaying broker credential publication with a debugger and verified the fix under the same delay. All four tests in ConsumerGroupCommandSaslAuthenticationTest pass with breakpoints disabled.
@github-actions github-actions Bot added triage PRs from the community tools tests Test fixes (including flaky tests) small Small PRs labels Sep 11, 2026

@majialoong majialoong left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the patch! Left a few comments.

Move the broker credential cache wait into createScramCredential, use the user parameter, and align indentation with surrounding code.

Tests: All four ConsumerGroupCommandSaslAuthenticationTest cases passed; tools Checkstyle and Spotless checks passed.
@github-actions github-actions Bot removed the triage PRs from the community label Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-approved small Small PRs tests Test fixes (including flaky tests) tools

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants