pnowojski commented on a change in pull request #9383: [FLINK-13248] [runtime]
Adding processing of downstream messages in AsyncWaitOperator's wait loops
URL: https://github.com/apache/flink/pull/9383#discussion_r314654604
##########
File path:
flink-streaming-java/src/test/java/org/apache/flink/streaming/api/operators/async/AsyncWaitOperatorTest.java
##########
@@ -771,9 +773,11 @@ public void testClosingWithBlockedEmitter() throws
Exception {
MockEnvironment environment = createMockEnvironment();
StreamTask<?, ?> containingTask = mock(StreamTask.class);
+ TaskMailboxImpl mailbox = new TaskMailboxImpl();
when(containingTask.getEnvironment()).thenReturn(environment);
when(containingTask.getCheckpointLock()).thenReturn(lock);
when(containingTask.getProcessingTimeService()).thenReturn(new
TestProcessingTimeService());
+
when(containingTask.getTaskMailboxExecutor(any())).thenReturn(new
MailboxExecutorImpl(mailbox));
Review comment:
Dropping mockito here should be easy:
```
+import org.apache.flink.streaming.util.MockStreamTask;
+import org.apache.flink.streaming.util.MockStreamTaskBuilder;
import org.apache.flink.streaming.util.OneInputStreamOperatorTestHarness;
import org.apache.flink.streaming.util.TestHarnessUtil;
import org.apache.flink.util.ExceptionUtils;
@@ -770,10 +772,10 @@ public class AsyncWaitOperatorTest extends TestLogger {
MockEnvironment environment = createMockEnvironment();
- StreamTask<?, ?> containingTask = mock(StreamTask.class);
-
when(containingTask.getEnvironment()).thenReturn(environment);
- when(containingTask.getCheckpointLock()).thenReturn(lock);
-
when(containingTask.getProcessingTimeService()).thenReturn(new
TestProcessingTimeService());
+ MockStreamTask containingTask = new
MockStreamTaskBuilder(environment)
+ .setCheckpointLock(lock)
+ .setProcessingTimeService(new
TestProcessingTimeService())
+ .build();
StreamConfig streamConfig = new MockStreamConfig();
streamConfig.setTypeSerializerIn1(IntSerializer.INSTANCE);
```
and adding a new setter and accessor for `getMailboxExecutor(int ignored) ->
mailbox`
If it's indeed that simple I would prefer it as `hotfix` commit in this PR.
Preferably as a base commit, before your changes, so that there is no
intermittent code that will be removed in a commit after. But if you do not
like the rebase hassle, I would be also ok in a `hotifx` commit on top of your
change.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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