TisonKun commented on a change in pull request #6729: [FLINK-10386] [taskmanager] Remove legacy class TaskExecutionStateListener URL: https://github.com/apache/flink/pull/6729#discussion_r222733909
########## File path: flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/tasks/StreamTaskTest.java ########## @@ -181,43 +175,26 @@ */ @Test public void testEarlyCanceling() throws Exception { - Deadline deadline = Deadline.fromNow(Duration.ofMinutes(2)); - StreamConfig cfg = new StreamConfig(new Configuration()); + final StreamConfig cfg = new StreamConfig(new Configuration()); cfg.setOperatorID(new OperatorID(4711L, 42L)); cfg.setStreamOperator(new SlowlyDeserializingOperator()); cfg.setTimeCharacteristic(TimeCharacteristic.ProcessingTime); - Task task = createTask(SourceStreamTask.class, cfg, new Configuration()); + final TaskManagerActions taskManagerActions = mock(TaskManagerActions.class); Review comment: I introduce a `NoOpTaskManagerActions` (in fact move an existing inner class to public) and `spy` on it. Because here we are mainly concerned about a specific function call happened, `verify` is the natural way IMO. Otherwise we might use a blocking queue and verify the message queue, more complex without additional benefit. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services