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

ASF GitHub Bot commented on FLINK-8731:
---------------------------------------

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

    https://github.com/apache/flink/pull/6338#discussion_r202604951
  
    --- Diff: 
flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/consumer/TestInputChannel.java
 ---
    @@ -125,4 +111,79 @@ public InputChannel getInputChannel() {
     
                return mocks;
        }
    +
    +   interface BufferAvailabilityProvider {
    +           Optional<BufferAndAvailability> getBufferAvailability() throws 
IOException, InterruptedException;
    +   }
    +
    +   class MockInputChannel extends InputChannel {
    +
    +           MockInputChannel(
    +                   SingleInputGate inputGate,
    +                   int channelIndex) {
    +                   super(inputGate, channelIndex, new ResultPartitionID(), 
0, 0, new SimpleCounter());
    +           }
    +
    +           private final Queue<BufferAvailabilityProvider> buffers = new 
ConcurrentLinkedQueue<>();
    +
    +           private BufferAvailabilityProvider lastProvider = null;
    --- End diff --
    
    move fields above constructor


> TwoInputStreamTaskTest flaky on travis
> --------------------------------------
>
>                 Key: FLINK-8731
>                 URL: https://issues.apache.org/jira/browse/FLINK-8731
>             Project: Flink
>          Issue Type: Bug
>          Components: Streaming, Tests
>    Affects Versions: 1.5.0
>            Reporter: Chesnay Schepler
>            Priority: Critical
>              Labels: pull-request-available, test-stability
>             Fix For: 1.5.2, 1.6.0
>
>
> https://travis-ci.org/zentol/flink/builds/344307861
> {code}
> Tests run: 5, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 2.479 sec <<< 
> FAILURE! - in org.apache.flink.streaming.runtime.tasks.TwoInputStreamTaskTest
> testOpenCloseAndTimestamps(org.apache.flink.streaming.runtime.tasks.TwoInputStreamTaskTest)
>   Time elapsed: 0.05 sec  <<< ERROR!
> java.lang.Exception: error in task
>       at 
> org.apache.flink.streaming.runtime.tasks.StreamTaskTestHarness.waitForTaskCompletion(StreamTaskTestHarness.java:250)
>       at 
> org.apache.flink.streaming.runtime.tasks.StreamTaskTestHarness.waitForTaskCompletion(StreamTaskTestHarness.java:233)
>       at 
> org.apache.flink.streaming.runtime.tasks.TwoInputStreamTaskTest.testOpenCloseAndTimestamps(TwoInputStreamTaskTest.java:99)
> Caused by: org.mockito.exceptions.misusing.WrongTypeOfReturnValue: 
> Boolean cannot be returned by getChannelIndex()
> getChannelIndex() should return int
> ***
> If you're unsure why you're getting above error read on.
> Due to the nature of the syntax above problem might occur because:
> 1. This exception *might* occur in wrongly written multi-threaded tests.
>    Please refer to Mockito FAQ on limitations of concurrency testing.
> 2. A spy is stubbed using when(spy.foo()).then() syntax. It is safer to stub 
> spies - 
>    - with doReturn|Throw() family of methods. More in javadocs for 
> Mockito.spy() method.
>       at 
> org.apache.flink.runtime.io.network.partition.consumer.UnionInputGate.waitAndGetNextInputGate(UnionInputGate.java:212)
>       at 
> org.apache.flink.runtime.io.network.partition.consumer.UnionInputGate.getNextBufferOrEvent(UnionInputGate.java:158)
>       at 
> org.apache.flink.streaming.runtime.io.BarrierBuffer.getNextNonBlocked(BarrierBuffer.java:164)
>       at 
> org.apache.flink.streaming.runtime.io.StreamTwoInputProcessor.processInput(StreamTwoInputProcessor.java:292)
>       at 
> org.apache.flink.streaming.runtime.tasks.TwoInputStreamTask.run(TwoInputStreamTask.java:115)
>       at 
> org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask.java:308)
>       at 
> org.apache.flink.streaming.runtime.tasks.StreamTaskTestHarness$TaskThread.run(StreamTaskTestHarness.java:437)
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to