rkhachatryan commented on code in PR #29954:
URL: https://github.com/apache/flink/pull/29954#discussion_r4611845230


##########
flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/tasks/StreamTaskTest.java:
##########
@@ -1564,6 +1575,134 @@ void 
testTaskAvoidHangingAfterSnapshotStateThrownException() throws Exception {
         }
     }
 
+    /** Aligned-checkpoint timeout used by the {@code alignedWithTimeout} 
checkpoint options. */
+    private static final long ALIGNED_CHECKPOINT_TIMEOUT_MS = 10_000L;
+
+    /** Upper bound of mailbox steps to wait for the checkpoint trigger to 
complete. */
+    private static final int MAX_MAILBOX_STEPS = 100;
+
+    static Stream<Named<CheckpointOptions>> 
provideCheckpointOptionsForOperatorEventOrdering() {
+        return Stream.of(
+                Named.of(
+                        "alignedNoTimeout",
+                        CheckpointOptions.alignedNoTimeout(
+                                CheckpointType.CHECKPOINT, getDefault())),
+                Named.of(
+                        "alignedWithTimeout",
+                        CheckpointOptions.alignedWithTimeout(
+                                CheckpointType.CHECKPOINT,
+                                getDefault(),
+                                ALIGNED_CHECKPOINT_TIMEOUT_MS)),
+                Named.of(
+                        "unaligned",
+                        CheckpointOptions.unaligned(CheckpointType.CHECKPOINT, 
getDefault())));
+    }
+
+    /**
+     * Operator events dispatched before a checkpoint trigger must be applied 
before the operator is
+     * snapshotted, including the case of an urgent (unaligned) trigger. 
Events are urgent mails too
+     * so that they keep FIFO order with the urgent trigger.
+     */
+    @ParameterizedTest
+    @MethodSource("provideCheckpointOptionsForOperatorEventOrdering")
+    void testOperatorEventsAreAppliedBeforeCheckpointTrigger(CheckpointOptions 
checkpointOptions)

Review Comment:
   Good point, I've added assertions to 
`testOperatorEventsAreAppliedBeforeCheckpointTrigger`, PTAL.



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