Copilot commented on code in PR #19817:
URL: https://github.com/apache/druid/pull/19817#discussion_r3684535659


##########
extensions-core/kafka-indexing-service/src/test/java/org/apache/druid/indexing/kafka/simulate/KafkaResourceTest.java:
##########
@@ -58,8 +59,19 @@ public void testKafka()
 
     // Test topic creation
     final String topicName = "test-topic";
-    resource.createTopicWithPartitions(topicName, 3);
+    resource.createTopicWithPartitions(topicName, 2);
     assertEquals(Set.of(topicName), resource.listTopics());
+
+    // Verify that records can be published immediately after adding 
partitions.
+    resource.increasePartitionsInTopic(topicName, 4);
+    resource.publishRecordsToTopicWithoutTransaction(
+        topicName,
+        Collections.nCopies(1_000, new byte[]{1})
+    );
+    final Map<String, Long> partitionOffsets = 
resource.getPartitionOffsets(topicName);
+    assertEquals(4, partitionOffsets.size());
+    assertEquals(1_000, 
partitionOffsets.values().stream().mapToLong(Long::longValue).sum());

Review Comment:
   The regression assertion here doesn’t ensure any records were actually 
written to the *new* partitions (2 and 3). With Kafka’s sticky partitioner for 
keyless records, it’s possible for all 1,000 records to land on a single 
partition and still satisfy `size()==4` and `sum()==1000`, so this may not 
reliably exercise the post-partition-increase leader readiness path described 
in the PR.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to