-
Notifications
You must be signed in to change notification settings - Fork 14.3k
KAFKA-18613: Unit tests for usage of incorrect RPCs #18383
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
Conversation
@@ -741,6 +741,7 @@ public List<StreamsGroupDescribeResponseData.DescribedGroup> streamsGroupDescrib | |||
describedGroups.add(new StreamsGroupDescribeResponseData.DescribedGroup() | |||
.setGroupId(groupId) | |||
.setErrorCode(Errors.GROUP_ID_NOT_FOUND.code()) | |||
.setErrorMessage(exception.getMessage()) |
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.
This was actually inconsistent to other group types
@@ -18,6 +18,7 @@ | |||
package org.apache.kafka.coordinator.group.taskassignor; | |||
|
|||
import org.apache.kafka.coordinator.group.GroupCoordinatorConfig; | |||
|
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.
spotlessApply
@@ -9373,7 +9375,8 @@ public void testStreamsGroupDescribeBeforeAndAfterCommittingOffset() { | |||
List<StreamsGroupDescribeResponseData.DescribedGroup> actual = context.groupMetadataManager.streamsGroupDescribe(Collections.singletonList(streamsGroupId), context.lastCommittedOffset); | |||
StreamsGroupDescribeResponseData.DescribedGroup describedGroup = new StreamsGroupDescribeResponseData.DescribedGroup() | |||
.setGroupId(streamsGroupId) | |||
.setErrorCode(Errors.GROUP_ID_NOT_FOUND.code()); | |||
.setErrorCode(Errors.GROUP_ID_NOT_FOUND.code()) | |||
.setErrorMessage("Group " + streamsGroupId + " not found."); |
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.
Updates behavior according to the above change to production code.
@@ -15673,6 +15676,349 @@ public void testReplayStreamsGroupTopologyTombstone() { | |||
assertThrows(GroupIdNotFoundException.class, () -> context.groupMetadataManager.streamsGroup("bar")); | |||
} | |||
|
|||
@Test | |||
public void testConsumerGroupHeartbeatOnStreamsGroup() { |
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.
The test are pretty repetitive - like the ones for the other group types. I considered saving some LOC (by using private helper methods, and parametrized tests), but kept them at way, since it's going to be easier to refactor if each test is self-contained.
@bbejeck is this still on your list? |
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.
Thanks for the PR @lucasbru - overall LGTM. There does not seem to be too much variance in creating a majority of the GroupMetadataManagerTestContext
object, maybe one helper method could help in this case. But that's up to you.
caa4e6c
to
3df4603
Compare
I retargeted this to trunk (I thought I had already). The tests weren't changed. |
999d3be
to
869234a
Compare
869234a
to
cbe6f3d
Compare
Tests for joining with missing source topics, internal topics, incorrectly partitioned topics, and stale topologies.
In the GroupMetadataManager, we may call an RPC on an incorrect group type. This adds unit tests to validate the behavior when an RPC is used on an incorrect group type.
cbe6f3d
to
3d71777
Compare
In the GroupMetadataManager, we may call an RPC on an incorrect group type. This adds unit tests to validate the behavior when an RPC is used on an incorrect group type. Reviewers: Bill Bejeck <[email protected]>
In the GroupMetadataManager, we may call an RPC on an incorrect group type. This adds unit tests to validate the behavior when an RPC is used on an incorrect group type.
Reviewers: Bill Bejeck [email protected]