zentol commented on a change in pull request #15030:
URL: https://github.com/apache/flink/pull/15030#discussion_r584617385



##########
File path: 
flink-test-utils-parent/flink-test-utils-junit/src/main/java/org/apache/flink/core/testutils/ManuallyTriggeredScheduledExecutorService.java
##########
@@ -166,6 +166,19 @@ public boolean awaitTermination(long timeout, TimeUnit 
unit) {
     // Execution triggering and access to the queued tasks
     // ------------------------------------------------------------------------
 
+    /**
+     * Executes all runnable and scheduled non-periodic tasks until none are 
left to run. This is
+     * essentially a combination of {@link #triggerAll()} and {@link
+     * #triggerNonPeriodicScheduledTasks()} that allows making a test agnostic 
of how exactly a
+     * runnable is passed to the executor.
+     */
+    public void triggerAllNonPeriodicTasks() {

Review comment:
       This method only exists to cover both runnable and non-periodic 
scheduled tasks, for the simple reason that I always had to check "is the code 
using execute() or schedule()?" and that became rather error-prone and annoying 
very quickly.




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to