-
Notifications
You must be signed in to change notification settings - Fork 13.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MINOR: Fix typo and refactor new group coordinator tests #17072
MINOR: Fix typo and refactor new group coordinator tests #17072
Conversation
Merge the tests for fetchOffsets and fetchAllOffsets together into parameterized tests since they share the same structure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @squah-confluent, I left some comments, PTAL. Thanks
@@ -1140,20 +1154,22 @@ public void testFetchOffsets( | |||
|
|||
if (requireStable) { | |||
when(runtime.scheduleWriteOperation( | |||
ArgumentMatchers.eq("fetch-offsets"), | |||
ArgumentMatchers.eq(fetchAllOffsets ? "fetch-all-offsets" : "fetch-offsets"), | |||
ArgumentMatchers.eq(new TopicPartition("__consumer_offsets", 0)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think __consumer_offsets
can replace by Topic.GROUP_METADATA_TOPIC_NAME
, use constant is better than string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
__consumer_offsets
is used throughout the new group coordinator tests. I think it makes sense to update all instances in the new group coordinator at once and pushed an update for it.
ArgumentMatchers.eq(new TopicPartition("__consumer_offsets", 0)), | ||
ArgumentMatchers.eq(Duration.ofMillis(5000)), | ||
ArgumentMatchers.any() | ||
)).thenReturn(CompletableFuture.completedFuture(response)); | ||
} else { | ||
when(runtime.scheduleReadOperation( | ||
ArgumentMatchers.eq("fetch-offsets"), | ||
ArgumentMatchers.eq(fetchAllOffsets ? "fetch-all-offsets" : "fetch-offsets"), | ||
ArgumentMatchers.eq(new TopicPartition("__consumer_offsets", 0)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
when(runtime.scheduleWriteOperation( | ||
ArgumentMatchers.eq("fetch-all-offsets"), | ||
ArgumentMatchers.eq(fetchAllOffsets ? "fetch-all-offsets" : "fetch-offsets"), | ||
ArgumentMatchers.eq(new TopicPartition("__consumer_offsets", 0)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
parameterized tests since they share the same structure.
new group coordinator tests.
Committer Checklist (excluded from commit message)