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


##########
raft/src/test/java/org/apache/kafka/raft/UnattachedStateWithVoteTest.java:
##########
@@ -83,35 +83,67 @@ public void testElectionTimeout() {
     public void testCanGrantVoteWithoutDirectoryId(boolean isLogUpToDate) {
         UnattachedState state = 
newUnattachedVotedState(ReplicaKey.NO_DIRECTORY_ID);
 
-        assertTrue(
-            state.canGrantVote(ReplicaKey.of(votedId, 
ReplicaKey.NO_DIRECTORY_ID), isLogUpToDate)
+        assertEquals(
+            isLogUpToDate,
+            state.canGrantPreVote(ReplicaKey.of(votedId, 
ReplicaKey.NO_DIRECTORY_ID), isLogUpToDate)
         );
-        assertTrue(
-            state.canGrantVote(
-                ReplicaKey.of(votedId, Uuid.randomUuid()),
-                isLogUpToDate
-            )
+        assertTrue(state.canGrantVote(ReplicaKey.of(votedId, 
ReplicaKey.NO_DIRECTORY_ID), isLogUpToDate));

Review Comment:
   It definitely is. I think it's correct for both states to act the way they 
do though. (Non-binding vs binding essentially)



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