KAFKA-20563: Fix flaky ShareConsumerRackAwareTest#22268
Open
AndrewJSchofield wants to merge 1 commit into
Open
KAFKA-20563: Fix flaky ShareConsumerRackAwareTest#22268AndrewJSchofield wants to merge 1 commit into
AndrewJSchofield wants to merge 1 commit into
Conversation
Comment on lines
+84
to
+85
| // No rack-local member found, which can be transiently true as membership changes. Pick any member for now. | ||
| assignedRack = rackIdToMemberId.keySet().iterator().next(); |
Contributor
There was a problem hiding this comment.
Thanks for deflaking the test!
Is leaving the partition unassigned an option? And would it be less confusing to folks debugging the test?
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.
ShareConsumerRackAwareTest is very slightly flaky. This is caused by the
fact that the assignor it uses is very particular about the combination
of members, assigned partitions and rack IDs. Because the assignment can
be performed at unpredictable points during the test, it is possible
that the set of members is incomplete when the assignment is calculated.
If any of the racks has no members, the assignor throws an exception and
the test then fails.
The PR makes the assignor tolerant of when there are no members for a
rack, just picking a random member to assign.
Reviewers: Sean Quah squah@confluent.io