[jira] [Commented] (FLINK-8731) TwoInputStreamTaskTest flaky on travis
[ https://issues.apache.org/jira/browse/FLINK-8731?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16545163#comment-16545163 ] Dawid Wysakowicz commented on FLINK-8731: - Fixed in 1.5 via 15e4939833e7a4c9a5cf2a97bb7368ebd17ed0cc Fixed in 1.6 via 010f6654709d2212f3d81c7ad73c73f7ebd47ea8 > 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 >Assignee: Dawid Wysakowicz >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)
[jira] [Commented] (FLINK-8731) TwoInputStreamTaskTest flaky on travis
[ https://issues.apache.org/jira/browse/FLINK-8731?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16545151#comment-16545151 ] Chesnay Schepler commented on FLINK-8731: - We should merge this to 1.5 so we don't chase test failures on that branch. > 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 >Assignee: Dawid Wysakowicz >Priority: Critical > Labels: pull-request-available, test-stability > Fix For: 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)
[jira] [Commented] (FLINK-8731) TwoInputStreamTaskTest flaky on travis
[ https://issues.apache.org/jira/browse/FLINK-8731?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16545141#comment-16545141 ] Dawid Wysakowicz commented on FLINK-8731: - Sure, were about to do it, just was wondering if I should merge it to 1.5 branch as well. > 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 >Assignee: Dawid Wysakowicz >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)
[jira] [Commented] (FLINK-8731) TwoInputStreamTaskTest flaky on travis
[ https://issues.apache.org/jira/browse/FLINK-8731?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16545120#comment-16545120 ] Chesnay Schepler commented on FLINK-8731: - Lets mark it as fixed then. > 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 >Assignee: Dawid Wysakowicz >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)
[jira] [Commented] (FLINK-8731) TwoInputStreamTaskTest flaky on travis
[ https://issues.apache.org/jira/browse/FLINK-8731?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16545116#comment-16545116 ] Dawid Wysakowicz commented on FLINK-8731: - I've replaced the mockito usage that was failing, therefore it should not occur any more. > 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)
[jira] [Commented] (FLINK-8731) TwoInputStreamTaskTest flaky on travis
[ https://issues.apache.org/jira/browse/FLINK-8731?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16545115#comment-16545115 ] ASF GitHub Bot commented on FLINK-8731: --- Github user asfgit closed the pull request at: https://github.com/apache/flink/pull/6338 > 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)
[jira] [Commented] (FLINK-8731) TwoInputStreamTaskTest flaky on travis
[ https://issues.apache.org/jira/browse/FLINK-8731?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16545112#comment-16545112 ] ASF GitHub Bot commented on FLINK-8731: --- Github user dawidwys commented on the issue: https://github.com/apache/flink/pull/6338 merging > 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)
[jira] [Commented] (FLINK-8731) TwoInputStreamTaskTest flaky on travis
[ https://issues.apache.org/jira/browse/FLINK-8731?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16544956#comment-16544956 ] 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_r202606214 --- Diff: flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/consumer/TestInputChannel.java --- @@ -81,26 +72,21 @@ public TestInputChannel readBuffer(boolean moreAvailable) throws IOException, In } public TestInputChannel readEndOfPartitionEvent() throws IOException, InterruptedException { - final Answer> answer = new Answer>() { - @Override - public Optional answer(InvocationOnMock invocationOnMock) throws Throwable { - // Return true after finishing - when(mock.isReleased()).thenReturn(true); - - return Optional.of(new BufferAndAvailability(EventSerializer.toBuffer(EndOfPartitionEvent.INSTANCE), false, 0)); + mock.addBufferAndAvailability( + new BufferAvailabilityProvider() { + @Override + public Optional getBufferAvailability() throws IOException, InterruptedException { + mock.setReleased(); + return Optional.of(new BufferAndAvailability(EventSerializer.toBuffer(EndOfPartitionEvent.INSTANCE), + false, + 0)); + } } - }; - - if (stubbing == null) { - stubbing = when(mock.getNextBuffer()).thenAnswer(answer); - } else { - stubbing = stubbing.thenAnswer(answer); - } - + ); return this; } - public InputChannel getInputChannel() { + public MockInputChannel getInputChannel() { --- End diff -- It would be good if we could get by without exposing the mock. As far as i can tell on GitHub the only usages of `MockInputChannel` methods outside of this class are in `StreamTestSingleInputGate`: ```inputChannels[channelIndex].getInputChannel().addBufferAndAvailability(answer);``` ```inputChannels[channelIndex].getInputChannel().setReleased();``` Since the `TestInputChannel` class is already accessed anyway we could move these methods to the TestChannel class. Note that currently this exposes a package-private class with a public method, which means that anyone without package-private access will get a compile error. Either make this method package private, or make the class public. > 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 >
[jira] [Commented] (FLINK-8731) TwoInputStreamTaskTest flaky on travis
[ https://issues.apache.org/jira/browse/FLINK-8731?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=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 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 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)
[jira] [Commented] (FLINK-8731) TwoInputStreamTaskTest flaky on travis
[ https://issues.apache.org/jira/browse/FLINK-8731?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16544632#comment-16544632 ] ASF GitHub Bot commented on FLINK-8731: --- GitHub user dawidwys opened a pull request: https://github.com/apache/flink/pull/6338 [FLINK-8731] Replaced mockito with custom mock in TestInputChannel Replaced questionable usage if Mockito with custom written mock. You can merge this pull request into a Git repository by running: $ git pull https://github.com/dawidwys/flink test-mock-lock Alternatively you can review and apply these changes as the patch at: https://github.com/apache/flink/pull/6338.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #6338 commit a2c78e6193c57bb69fc6f7d7b629ef0ec47171bb Author: Dawid Wysakowicz Date: 2018-07-12T14:17:48Z [FLINK-8731] Replaced mockito with custom mock in TestInputChannel > 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)
[jira] [Commented] (FLINK-8731) TwoInputStreamTaskTest flaky on travis
[ https://issues.apache.org/jira/browse/FLINK-8731?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16419195#comment-16419195 ] Till Rohrmann commented on FLINK-8731: -- Unblocking 1.5.0 since it seems to be a test setup problem with {{Mockito}}. > 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: Blocker > Labels: test-stability > Fix For: 1.5.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)