You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2020/12/22 04:07:58 UTC

[GitHub] [kafka] chia7712 commented on a change in pull request #9775: KAFKA-8460: reduce the record size and increase the delay time

chia7712 commented on a change in pull request #9775:
URL: https://github.com/apache/kafka/pull/9775#discussion_r547054932



##########
File path: core/src/test/scala/integration/kafka/api/PlaintextConsumerTest.scala
##########
@@ -801,8 +801,10 @@ class PlaintextConsumerTest extends BaseConsumerTest {
     awaitAssignment(consumer, partitions.toSet)
 
     val producer = createProducer()
-    val producerRecords = partitions.flatMap(sendRecords(producer, numRecords = 15, _))
-    val consumerRecords = consumeRecords(consumer, producerRecords.size)
+    // we produce 10 records for each topic partition. There are 3 topics, and 30 partitions each topic,
+    // so total producerRecords size should be 10 * 3 * 30 = 900
+    val producerRecords = partitions.flatMap(sendRecords(producer, numRecords = 10, _))
+    val consumerRecords = consumeRecords(consumer, producerRecords.size, waitTimeMs = 90 * 1000)

Review comment:
       Personally, 90 seconds is too long to be a test case. Reducing the produce size can't resolve this issue?

##########
File path: core/src/test/scala/integration/kafka/api/AbstractConsumerTest.scala
##########
@@ -148,16 +148,17 @@ abstract class AbstractConsumerTest extends BaseRequestTest {
 
   protected def consumeRecords[K, V](consumer: Consumer[K, V],
                                      numRecords: Int,
-                                     maxPollRecords: Int = Int.MaxValue): ArrayBuffer[ConsumerRecord[K, V]] = {
+                                     maxPollRecords: Int = Int.MaxValue,
+                                     waitTimeMs: Int = 60000): ArrayBuffer[ConsumerRecord[K, V]] = {
     val records = new ArrayBuffer[ConsumerRecord[K, V]]

Review comment:
       Could you add the initial size? It collects all return records so the default size is too small to this case.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org