ahuang98 commented on code in PR #18240:
URL: https://github.com/apache/kafka/pull/18240#discussion_r1917459804


##########
raft/src/test/java/org/apache/kafka/raft/KafkaRaftClientTest.java:
##########
@@ -323,9 +324,21 @@ public void 
testInitializeAsResignedAndBecomeCandidate(boolean withKip853Rpc) th
         context.time.sleep(context.electionTimeoutMs());
         context.client.poll();
 
-        // Become candidate in a new epoch
-        assertTrue(context.client.quorum().isCandidate());
-        context.assertVotedCandidate(epoch + 1, localId);
+        // Become unattached with expired election timeout
+        assertTrue(context.client.quorum().isUnattached());
+        assertEquals(epoch + 1, context.currentEpoch());
+
+        // Become prospective
+        context.time.sleep(1);
+        context.client.poll();
+        assertTrue(context.client.quorum().isProspective());
+
+        // Become unattached again after election timeout
+        ProspectiveState prospectiveState = 
context.client.quorum().prospectiveStateOrThrow();
+        
context.time.sleep(prospectiveState.remainingElectionTimeMs(context.time.milliseconds()));

Review Comment:
   no strong reason, I'll standardize



-- 
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: jira-unsubscr...@kafka.apache.org

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

Reply via email to