dawidwys commented on a change in pull request #16415:
URL: https://github.com/apache/flink/pull/16415#discussion_r666054922
##########
File path:
flink-tests/src/test/java/org/apache/flink/test/streaming/api/FileReadingWatermarkITCase.java
##########
@@ -62,8 +64,17 @@ public void testWatermarkEmissionWithChaining() throws
Exception {
JobExecutionResult result = env.execute();
int actual = result.getAccumulatorResult(NUM_WATERMARKS_ACC_NAME);
-
- assertTrue("too few watermarks emitted: " + actual, actual >=
MIN_EXPECTED_WATERMARKS);
+ long expected =
Review comment:
This computation seems a bit off for me. The `RUNTIME_ACC_NAME` is taken
long after there can be watermarks generated.
`close` is called to release resources, one we closed the mailbox, all
timers waited for pending checkpoints etc. All those actions might take some
time, but that should not add to the expected number of watermarks.
##########
File path:
flink-tests/src/test/java/org/apache/flink/test/streaming/api/FileReadingWatermarkITCase.java
##########
@@ -62,8 +64,17 @@ public void testWatermarkEmissionWithChaining() throws
Exception {
JobExecutionResult result = env.execute();
int actual = result.getAccumulatorResult(NUM_WATERMARKS_ACC_NAME);
-
- assertTrue("too few watermarks emitted: " + actual, actual >=
MIN_EXPECTED_WATERMARKS);
+ long expected =
+ result.<Long>getAccumulatorResult(RUNTIME_ACC_NAME) /
WATERMARK_INTERVAL_MILLIS;
+ checkState(expected > MIN_EXPECTED_WATERMARKS);
+
+ assertEquals(
+ "too few watermarks emitted in "
+ + result.<Long>getAccumulatorResult(RUNTIME_ACC_NAME)
+ + " ms",
+ expected,
+ actual,
+ .5 * expected);
Review comment:
Where does the delta come from? Isn't it too big? Does it mean that the
number of checkpoints can be just half of the `expected` number?
--
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]