zhijiangW commented on a change in pull request #11515: [FLINK-16744][task] 
implement channel state persistence for unaligned checkpoints
URL: https://github.com/apache/flink/pull/11515#discussion_r401342017
 
 

 ##########
 File path: 
flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/tasks/SourceTaskTerminationTest.java
 ##########
 @@ -122,6 +124,26 @@ private void stopWithSavepointStreamTaskTestHelper(final 
boolean withMaxWatermar
                executionThread.join();
        }
 
+       private void waitForLatchSetByTask(OneShotLatch latch, 
StreamTaskTestHarness<?> srcTaskTestHarness) throws Exception {
+               final StreamTask<?, ?> srcTask = srcTaskTestHarness.getTask();
+               final Thread executionThread = srcTaskTestHarness.taskThread;
+               while (executionThread.isAlive() && srcTask.isRunning()) {
 
 Review comment:
   I guess we can merge the following `while` and `if` logics into this `while` 
to avoid judging `srcTask.isRunning()` three times separately, and make the 
logics more close with each other.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to