You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2020/04/22 19:41:31 UTC

[GitHub] [kafka] hachikuji commented on a change in pull request #8445: KAFKA-9823: Remember the sent generation for the coordinator request

hachikuji commented on a change in pull request #8445:
URL: https://github.com/apache/kafka/pull/8445#discussion_r413250770



##########
File path: clients/src/test/java/org/apache/kafka/clients/consumer/internals/AbstractCoordinatorTest.java
##########
@@ -466,24 +477,193 @@ public void testSyncGroupRequestWithFencedInstanceIdException() {
     }
 
     @Test
-    public void testHeartbeatUnknownMemberResponseDuringRebalancing() throws InterruptedException {
+    public void testJoinGroupUnknownMemberResponseWithOldGeneration() throws InterruptedException {
         setupCoordinator();
-        mockClient.prepareResponse(groupCoordinatorResponse(node, Errors.NONE));
+        joinGroup();
 
-        final int generation = 1;
+        final AbstractCoordinator.Generation currGen = coordinator.generation();
 
-        mockClient.prepareResponse(joinGroupFollowerResponse(generation, memberId, JoinGroupRequest.UNKNOWN_MEMBER_ID, Errors.NONE));
-        mockClient.prepareResponse(syncGroupResponse(Errors.NONE));
+        RequestFuture<ByteBuffer> future = coordinator.sendJoinGroupRequest();
 
-        coordinator.ensureActiveGroup();
+        TestUtils.waitForCondition(() -> !mockClient.requests().isEmpty(), 2000,
+            "The join-group request was not sent in time after");

Review comment:
       nit: after.. what? I think you can drop "in time after." Here is the assertion that is used:
   ```
               assertThat("Condition not met within timeout " + maxWaitMs + ". " + conditionDetails,
                   testCondition.conditionMet());
   ```




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org