pnowojski commented on a change in pull request #8858: [hotfix][tests] Change 
some StreamTask tests to create a test task in the task's thread
URL: https://github.com/apache/flink/pull/8858#discussion_r297161516
 
 

 ##########
 File path: 
flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/tasks/StreamTaskTestHarness.java
 ##########
 @@ -232,15 +231,18 @@ public Thread invoke() throws Exception {
         *
         */
        public Thread invoke(StreamMockEnvironment mockEnv) throws Exception {
+               checkState(this.mockEnv == null);
+               checkState(this.taskThread == null);
                this.mockEnv = checkNotNull(mockEnv);
 
                initializeInputs();
                initializeOutput();
 
-               this.task = taskFactory.apply(mockEnv);
-
-               taskThread = new TaskThread(task);
+               taskThread = new TaskThread(() -> taskFactory.apply(mockEnv));
 
 Review comment:
   I'm missing the information why do we need this change. Could you explain 
more in the commit message and maybe optionally somewhere in the code as a 
comment? 

----------------------------------------------------------------
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

Reply via email to