KAFKA-21069: Fix flaky consumer group authentication tests - #23430
Open
andyhuangdev wants to merge 3 commits into
Open
andyhuangdev wants to merge 3 commits into
andyhuangdev wants to merge 3 commits into
Conversation
…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.
majialoong
reviewed
Sep 13, 2026
majialoong
left a comment
Collaborator
There was a problem hiding this comment.
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.
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.
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
ConsumerGroupCommandSaslAuthenticationTestpass with breakpoints disabled.Reviewers: majialong majialoong@gmail.com