zentol commented on code in PR #24309:
URL: https://github.com/apache/flink/pull/24309#discussion_r1489188467


##########
flink-test-utils-parent/flink-test-utils-junit/src/main/java/org/apache/flink/core/testutils/ManuallyTriggeredScheduledExecutorService.java:
##########
@@ -318,11 +319,22 @@ public void triggerNonPeriodicScheduledTasks(Class<?> 
taskClazz) {
     public void triggerPeriodicScheduledTasks() {
         for (ScheduledTask<?> scheduledTask : periodicScheduledTasks) {
             if (!scheduledTask.isCancelled()) {
-                scheduledTask.execute();
+                executeScheduledTask(scheduledTask);
             }
         }
     }
 
+    private static void executeScheduledTask(ScheduledTask<?> scheduledTask) {
+        scheduledTask.execute();
+        try {
+            // try to retrieve result of scheduled task to avoid swallowing 
any exceptions that
+            // occurred
+            scheduledTask.get();

Review Comment:
   This doesn't work for periodic tasks since the result future in the 
ScheduledTask never gets completed.
   
   I'm not sure if this change is correct in the first place. Every 
non-periodic task already throws exceptions when trigger is called.



-- 
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: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to