jsancio commented on code in PR #16637:
URL: https://github.com/apache/kafka/pull/16637#discussion_r1687120661


##########
raft/src/test/java/org/apache/kafka/raft/KafkaRaftClientTest.java:
##########
@@ -2763,78 +2765,396 @@ public void testDescribeQuorumNonLeader(boolean 
withKip853Rpc) throws Exception
     }
 
     @ParameterizedTest
-    @ValueSource(booleans = { true, false })
-    public void testDescribeQuorum(boolean withKip853Rpc) throws Exception {
-        int localId = randomReplicaId();
-        ReplicaKey closeFollower = replicaKey(localId + 2, withKip853Rpc);
-        ReplicaKey laggingFollower = replicaKey(localId + 1, withKip853Rpc);
-        Set<Integer> voters = Utils.mkSet(localId, closeFollower.id(), 
laggingFollower.id());
+    @CsvSource({ "true,0", "true,1", "false,0", "false,1" })
+    public void testDescribeQuorumOld(boolean withKip853Rpc, short apiVersion) 
throws Exception {
+        int localId = 0;
+        ReplicaKey local = replicaKey(localId, withKip853Rpc);
+        ReplicaKey follower1 = replicaKey(1, withKip853Rpc);
+        Set<Integer> voters = Utils.mkSet(localId, follower1.id());
+        VoterSet voterSet = VoterSetTest.voterSet(Stream.of(local, follower1));
+
+        RaftClientTestContext.Builder builder = new 
RaftClientTestContext.Builder(localId, 
local.directoryId().orElse(ReplicaKey.NO_DIRECTORY_ID))
+            .withStaticVoters(voters)
+            .withKip853Rpc(true);

Review Comment:
   > I want this test to check the local leader is able to handle older 
versions of describe quorum requests (versions 0 and 1) no matter if it 
supports kip853Rpc or not
   
   Then call `withKip853Rpc(false)`. Please take a loot at the implementation 
but that flag basically determines which version of the RPCs to send.



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