[ 
https://issues.apache.org/jira/browse/FLINK-2180?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14576968#comment-14576968
 ] 

Gábor Hermann commented on FLINK-2180:
--------------------------------------

I could only reproduce this with sleeping in the IterationHead function here
https://github.com/apache/flink/blob/master/flink-staging/flink-streaming/flink-streaming-core/src/test/java/org/apache/flink/streaming/api/IterateTest.java#L50

The iteration maximum wait time is set to 3000, that means the iteration would 
stop if it does not get a new element in 3 seconds. I can only think that the 
test fails because sometimes the elements arrive that slow and the iteration 
finishes prematurely.

I suggest to add a feature so that a predicate could be defined that indicates 
when to end the iteration. Like this:

dataStream.iterate(new EndOfIterationPredicate() {
  boolean isEndOfIteration(value) {
     // ...
  }
})

and rewrite the test using this.
I guess that would be useful for some users too. (Mainly for debugging 
purposes, as the aim of the max. wait time is also only for debugging.)

> Streaming iterate test fails spuriously
> ---------------------------------------
>
>                 Key: FLINK-2180
>                 URL: https://issues.apache.org/jira/browse/FLINK-2180
>             Project: Flink
>          Issue Type: Bug
>          Components: Streaming
>    Affects Versions: 0.9
>            Reporter: Márton Balassi
>            Assignee: Gábor Hermann
>
> Following output seen occasionally: 
> Tests run: 3, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 3.667 sec <<< 
> FAILURE! - in org.apache.flink.streaming.api.IterateTest
> test(org.apache.flink.streaming.api.IterateTest)  Time elapsed: 3.662 sec  
> <<< FAILURE!
> java.lang.AssertionError: null
>       at org.junit.Assert.fail(Assert.java:86)
>       at org.junit.Assert.assertTrue(Assert.java:41)
>       at org.junit.Assert.assertTrue(Assert.java:52)
>       at org.apache.flink.streaming.api.IterateTest.test(IterateTest.java:154)
> See: https://travis-ci.org/mbalassi/flink/jobs/65803465



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to