You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2019/12/03 19:07:33 UTC

[GitHub] [flink] hwanju commented on a change in pull request #10387: [FLINK-14949] [Runtime/Task] Task cancellation can be stuck against out-of-thread error

hwanju commented on a change in pull request #10387: [FLINK-14949] [Runtime/Task] Task cancellation can be stuck against out-of-thread error
URL: https://github.com/apache/flink/pull/10387#discussion_r353352396
 
 

 ##########
 File path: flink-runtime/src/test/java/org/apache/flink/runtime/taskmanager/TaskTest.java
 ##########
 @@ -825,6 +828,78 @@ public void testFatalErrorAfterUnInterruptibleInvoke() throws Exception {
 		}
 	}
 
+	/**
+	 * Tests that a fatal error gotten from canceling task is notified.
+	 */
+	@Test
+	public void testFatalErrorOnCanceling() throws Exception {
+		final AwaitFatalErrorTaskManagerActions taskManagerActions =
+			new AwaitFatalErrorTaskManagerActions();
+
+		final Configuration config = new Configuration();
+		config.setLong(TaskManagerOptions.TASK_CANCELLATION_INTERVAL, 5);
+		config.setLong(TaskManagerOptions.TASK_CANCELLATION_TIMEOUT, 50);
+
+		final Task task = spy(createTaskBuilder()
+			.setInvokable(InvokableBlockingWithTrigger.class)
+			.setTaskManagerConfig(config)
+			.setTaskManagerActions(taskManagerActions)
+			.build());
+
+		doThrow(OutOfMemoryError.class).when(task).cancelOrFailAndCancelInvokableInternal(eq(ExecutionState.CANCELING), eq(null));
 
 Review comment:
   Yeah, without starting mocking like this, I was about to propose that we may rely on manual test without unit testing for this fatal test. Same here, I couldn't get better way, so having waited for a comment. By your following comment, I can reduce the number of tests to one at least to reduce ugliness :)

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services