haishui126 commented on code in PR #22291:
URL: https://github.com/apache/flink/pull/22291#discussion_r1167684957


##########
flink-streaming-java/src/test/java/org/apache/flink/streaming/api/operators/SourceOperatorAlignmentTest.java:
##########
@@ -160,13 +160,18 @@ public void testWatermarkAlignmentWithIdleness() throws 
Exception {
             expectedOutput.add(record1);
             context.getTimeService().advance(1);
             assertLatestReportedWatermarkEvent(context, record1);
+            // mock WatermarkAlignmentEvent from SourceCoordinator
+            operator.handleOperatorEvent(new WatermarkAlignmentEvent(record1 + 
100));
             assertOutput(actualOutput, expectedOutput);
             assertTrue(operator.isAvailable());
 
             // source becomes idle, it should report Long.MAX_VALUE as the 
watermark
             assertThat(operator.emitNext(actualOutput), 
is(DataInputStatus.NOTHING_AVAILABLE));
             context.getTimeService().advance(1);
             assertLatestReportedWatermarkEvent(context, Long.MAX_VALUE);
+            // receive Long.MAX_VALUE as WatermarkAlignmentEvent
+            // because reported Long.MAX_VALUE watermark + 
maxAllowedWatermarkDrift will overflow

Review Comment:
   I agree with you. I‘ll edit the comment later.



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