Github user tillrohrmann commented on a diff in the pull request:

    https://github.com/apache/flink/pull/5728#discussion_r176678985
  
    --- Diff: 
flink-tests/src/test/java/org/apache/flink/test/streaming/runtime/TimestampITCase.java
 ---
    @@ -185,22 +177,23 @@ public void 
testWatermarkPropagationNoFinalWatermarkOnStop() throws Exception {
                                .transform("Custom Operator", 
BasicTypeInfo.INT_TYPE_INFO, new CustomOperator(true))
                                .addSink(new DiscardingSink<Integer>());
     
    -           new Thread("stopper") {
    +           Thread t = new Thread("stopper") {
                        @Override
                        public void run() {
                                try {
                                        // try until we get the running jobs
    -                                   List<JobID> running;
    -                                   while ((running = 
cluster.getCurrentlyRunningJobsJava()).isEmpty()) {
    +                                   List<JobID> running = 
getRunningJobs(clusterClient);
    +                                   while (running.isEmpty()) {
                                                Thread.sleep(10);
    +                                           running = 
getRunningJobs(clusterClient);
                                        }
     
    -                                   JobID id = running.get(0);
    +                                   JobID id = running.iterator().next();
    --- End diff --
    
    could also be `running.get(0)`, then we don't create an additional iterator 
object


---

Reply via email to