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/02/14 10:01:03 UTC

[GitHub] GJL commented on a change in pull request #7683: [FLINK-11486][tests] Port RecoveryITCase to new code base

GJL commented on a change in pull request #7683: [FLINK-11486][tests] Port RecoveryITCase to new code base
URL: https://github.com/apache/flink/pull/7683#discussion_r256763043
 
 

 ##########
 File path: flink-runtime/src/test/java/org/apache/flink/runtime/taskexecutor/TaskExecutorITCase.java
 ##########
 @@ -111,6 +106,40 @@ public void testNewTaskExecutorJoinsCluster() throws Exception {
 		miniCluster.requestJobResult(jobGraph.getJobID()).get();
 	}
 
+	/**
+	 * Tests that the job can recover from a failing {@link TaskExecutor}.
+	 */
+	@Test
+	public void testJobRecoveryWithFailingTaskExecutor() throws Exception {
+		final JobGraph jobGraph = createJobGraphWithRestartStrategy(PARALLELISM);
+
+		final CompletableFuture<JobResult> jobResultFuture = submitJobAndWaitUntilRunning(jobGraph);
+
+		// start an additional TaskExecutor
+		miniCluster.startTaskExecutor();
+
+		miniCluster.terminateTaskExecutor(0).get(); // this should fail the job
+
+		BlockingOperator.unblock();
+
+		assertThat(jobResultFuture.get().isSuccess(), is(true));
+	}
+
+	private CompletableFuture<JobResult> submitJobAndWaitUntilRunning(JobGraph jobGraph) throws Exception {
+		miniCluster.submitJob(jobGraph).get();
+
+		final CompletableFuture<JobResult> jobResultFuture = miniCluster.requestJobResult(jobGraph.getJobID());
+
+		assertThat(jobResultFuture.isDone(), is(false));
+
+		CommonTestUtils.waitUntilCondition(
+			jobIsRunning(() -> miniCluster.getExecutionGraph(jobGraph.getJobID())),
+			Deadline.fromNow(TESTING_TIMEOUT),
+			20L);
 
 Review comment:
   There is a bug in `waitUntilCondition` which leads to `20` being ignored.

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


With regards,
Apache Git Services