imaffe commented on a change in pull request #17937:
URL: https://github.com/apache/flink/pull/17937#discussion_r763942770



##########
File path: 
flink-connectors/flink-connector-pulsar/src/test/java/org/apache/flink/connector/pulsar/source/reader/split/PulsarOrderedPartitionSplitReaderTest.java
##########
@@ -34,4 +43,57 @@
                 sourceConfig(),
                 flinkSchema(new SimpleStringSchema()));
     }
+
+    @Test
+    void consumeMessageCreatedBeforeHandleSplitsChangesWithoutSeek() {
+        PulsarPartitionSplitReaderBase<String> splitReader = splitReader();
+        String topicName = randomAlphabetic(10);
+        operator().setupTopic(topicName, STRING, () -> randomAlphabetic(10));
+        handleSplit(splitReader, topicName, 0);
+        fetchedMessages(splitReader, 0, true);
+    }
+
+    @Test
+    void 
consumeMessageCreatedBeforeHandleSplitsChangesAndUseLatestStartCursorWithoutSeek()
 {
+        PulsarPartitionSplitReaderBase<String> splitReader = splitReader();
+        String topicName = randomAlphabetic(10);
+        operator().setupTopic(topicName, STRING, () -> randomAlphabetic(10));
+        handleSplit(splitReader, topicName, 0, MessageId.latest);
+        fetchedMessages(splitReader, 0, true);
+    }
+
+    @Test
+    void 
consumeMessageCreatedBeforeHandleSplitsChangesAndUseEarliestStartCursorWithoutSeek()
 {
+        PulsarPartitionSplitReaderBase<String> splitReader = splitReader();
+        String topicName = randomAlphabetic(10);
+        operator().setupTopic(topicName, STRING, () -> randomAlphabetic(10));
+        handleSplit(splitReader, topicName, 0, MessageId.earliest);
+        fetchedMessages(splitReader, NUM_RECORDS_PER_PARTITION, true);
+    }

Review comment:
       Oh they are different test cases. Using latest and latest - 1 has 
different semantics (and different code paths). But sure Parameterized test 
will also be feasible.




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


Reply via email to