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


##########
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:
   Addressed in `cb6d8b2e66` and refined in `3b49ef3f3f`. The regression test 
now publishes directly to every partition after topic creation and after 
expanding from two to four partitions, explicitly targeting new partitions 2 
and 3, and asserts the exact per-partition offsets. `KafkaResourceTest` passes 
locally.



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