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


##########
raft/src/test/java/org/apache/kafka/raft/RaftEventSimulationTest.java:
##########
@@ -550,14 +576,17 @@ void canAddObserverAndRemovePartitionedVoter(
 
         initializeClusterAndStartAppending(cluster, router, scheduler, 10);
 
-        // Partition a random voter, and add an observer to replace it
-        RaftNode voterToRemove = 
cluster.running.get(random.nextInt(numVoters));
-        router.filter(voterToRemove.id(), new DropAllTraffic());
+        // Partition a random voter. Add first observer as new voter
+        int voterIdToRemove = 
cluster.running.get(random.nextInt(numVoters)).id();
+        router.filter(voterIdToRemove, new DropAllTraffic());
+        expectedVoterIds.add(numVoters);

Review Comment:
   nit: would be more readable if you used a new var like `firstsObserverId` 
and assigned to value of numVoters at beginning of test



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

Reply via email to