jsancio commented on code in PR #17807: URL: https://github.com/apache/kafka/pull/17807#discussion_r1882520558
########## 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: Interesting that pre-vote can be false when normal vote is true. -- 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