etolbakov commented on code in PR #12388:
URL: https://github.com/apache/kafka/pull/12388#discussion_r916752022
##########
clients/src/test/java/org/apache/kafka/clients/consumer/internals/AbstractCoordinatorTest.java:
##########
@@ -1164,6 +1168,34 @@ public void testHandleNormalLeaveGroupResponse() {
assertTrue(leaveGroupFuture.succeeded());
}
+ @Test
+ public void testHandleNormalLeaveGroupResponseAndTruncatedLeaveReason() {
+ MemberResponse memberResponse = new MemberResponse()
+ .setMemberId(memberId)
+ .setErrorCode(Errors.NONE.code());
+ LeaveGroupResponse leaveGroupResponse =
+ leaveGroupResponse(Collections.singletonList(memberResponse));
+ String leaveReason = "Very
looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong
leaveReason that is 271 characters long to make sure that length limit logic
handles the scenario nicely";
+ setupCoordinator(RETRY_BACKOFF_MS, Integer.MAX_VALUE,
Optional.empty());
+
+ mockClient.prepareResponse(groupCoordinatorResponse(node,
Errors.NONE));
Review Comment:
@dajac I've drafted the change for the `KafkaAdminClient` (you've mentioned
it earlier, sorry overlooked), it feels that the method `truncateIfRequired`
should be coverted to an util one.
I'm thinking of putting it in `org.apache.kafka.common.utils.Utils` but
could you please give any suggestion if there's a more suitable place?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]