Github user JasonMWhite commented on a diff in the pull request:

    https://github.com/apache/spark/pull/10089#discussion_r47363415
  
    --- Diff: 
external/kafka/src/test/scala/org/apache/spark/streaming/kafka/DirectKafkaStreamSuite.scala
 ---
    @@ -364,8 +365,8 @@ class DirectKafkaStreamSuite
     
         val batchIntervalMilliseconds = 100
         val estimator = new ConstantEstimator(100)
    -    val messageKeys = (1 to 200).map(_.toString)
    -    val messages = messageKeys.map((_, 1)).toMap
    +    val messages = Map("foo" -> 200)
    +    kafkaTestUtils.sendMessages(topic, messages)
    --- End diff --
    
    In the original code, as I understand it, since the Kafka test setup wasn't 
cleared/reinitialized between testing rounds, only the first batch of 200 
messages, produced in the first of 3 test rounds, was ever consumed. The other 
testing rounds produced messages that were never used. My changes aside, I 
think moving the test message generation outside of the individual test rounds 
makes the most sense.
    
    This failure scenario depended on imbalanced Kafka partitions, would you 
prefer to see tests on both a balanced and an imbalanced scenario?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to