StefanRRichter commented on a change in pull request #7753: 
[FLINK-11041][tests] Fix ReinterpretDataStreamAsKeyedStreamITCase
URL: https://github.com/apache/flink/pull/7753#discussion_r258493411
 
 

 ##########
 File path: 
flink-streaming-java/src/test/java/org/apache/flink/streaming/api/datastream/ReinterpretDataStreamAsKeyedStreamITCase.java
 ##########
 @@ -207,33 +213,34 @@ public void close() throws Exception {
 
                @Override
                public void run(SourceContext<Tuple2<Integer, Integer>> out) 
throws Exception {
-                       this.running = true;
-                       try {
-                               while (running) {
 
-                                       checkFail();
+                       running = true;
 
-                                       synchronized (out.getCheckpointLock()) {
-                                               Integer key = din.readInt();
-                                               Integer val = din.readInt();
-                                               out.collect(new Tuple2<>(key, 
val));
+                       while (running && hasMoreDataToRead()) {
 
-                                               position += 2 * Integer.BYTES;
-                                       }
+                               synchronized (out.getCheckpointLock()) {
+                                       position += 2 * Integer.BYTES;
 
 Review comment:
   I agree, in that case I cannot pinpoint which change did the trick :( 
However, I was running the modified test in a loop on Travis and it did not 
fail once in > 500 iterations.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to