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

    https://github.com/apache/flink/pull/2509#discussion_r89756558
  
    --- Diff: 
flink-streaming-connectors/flink-connector-kafka-base/src/test/java/org/apache/flink/streaming/connectors/kafka/KafkaConsumerTestBase.java
 ---
    @@ -482,12 +476,39 @@ public void runStartFromEarliestOffsets() throws 
Exception {
         * ignores the "auto.offset.reset" behaviour as well as any committed 
group offsets in Kafka.
         */
        public void runStartFromLatestOffsets() throws Exception {
    --- End diff --
    
    To make this test easier without having to sleep, the test now does this:
    
    1. First write 50 records to each partition (these shouldn't be read)
    2. Set some offsets in Kafka (should be ignored)
    3. Start a latest-reading consuming job. This jobs throws exception if it 
reads any of the first 50 records
    4. Wait until the consume job has fully started (added an util method to 
`JobManagerCommunicationUtils` for this)
    5. Write 200 extra records to each partition.
    6. Once the writing finishes, cancel the consume job.
    7. Check if the consume job threw any test errors.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to