1996fanrui commented on code in PR #24757:
URL: https://github.com/apache/flink/pull/24757#discussion_r1637386871


##########
flink-runtime/src/test/java/org/apache/flink/runtime/source/coordinator/SourceCoordinatorAlignmentTest.java:
##########
@@ -310,6 +310,53 @@ void testWatermarkAggregatorRandomly() {
         testWatermarkAggregatorRandomly(10, 10000, true, false);
     }
 
+    @Test
+    void testWatermarkAlignmentWhileSubtaskFinished() throws Exception {
+        long maxDrift = 1000L;
+        WatermarkAlignmentParams params =
+                new WatermarkAlignmentParams(maxDrift, "group1", maxDrift);
+
+        final Source<Integer, MockSourceSplit, Set<MockSourceSplit>> 
mockSource =
+                createMockSource();
+
+        sourceCoordinator =
+                new SourceCoordinator<MockSourceSplit, Set<MockSourceSplit>>(
+                        OPERATOR_NAME,
+                        mockSource,
+                        getNewSourceCoordinatorContext(),
+                        new CoordinatorStoreImpl(),
+                        params,
+                        null) {
+                    @Override
+                    void announceCombinedWatermark() {
+                        super.announceCombinedWatermark();
+                    }
+                };
+
+        sourceCoordinator.start();
+
+        int subtask0 = 0;
+        int subtask1 = 1;
+
+        setReaderTaskReady(sourceCoordinator, subtask0, 0);
+        setReaderTaskReady(sourceCoordinator, subtask1, 0);
+        registerReader(subtask0);
+        registerReader(subtask1);
+
+        reportWatermarkEvent(sourceCoordinator, subtask0, 42);
+        assertLatestWatermarkAlignmentEvent(subtask0, 1042);
+
+        reportWatermarkEvent(sourceCoordinator, subtask1, 44);
+        assertLatestWatermarkAlignmentEvent(subtask1, 1042);
+
+        // mock noMoreSplits event
+        assertHasNoMoreSplits(subtask0, true);

Review Comment:
   > My intention is to add a test case to simulate the sending of the 
noMoreSplits event
   
   Actually, this test is testing the watermark result when the watermark of 
one subtask is Long.Max, right?
   
   I think this test can be removed.



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