tillrohrmann commented on a change in pull request #10646:
[FLINK-15320][runtime] Increment versions of all vertices when
failing/canceling/suspending a job
URL: https://github.com/apache/flink/pull/10646#discussion_r360835968
##########
File path:
flink-runtime/src/test/java/org/apache/flink/runtime/scheduler/DefaultSchedulerTest.java
##########
@@ -550,6 +550,53 @@ public void testInputConstraintALLPerf() throws Exception
{
assertThat(duration, lessThan(timeout));
}
+ @Test
+ public void failJobWillIncrementVertexVersions() {
+ final JobGraph jobGraph = singleNonParallelJobVertexJobGraph();
+ final JobVertex onlyJobVertex = getOnlyJobVertex(jobGraph);
+ final ExecutionVertexID onlyExecutionVertexId = new
ExecutionVertexID(onlyJobVertex.getID(), 0);
+
+ // suppress restarts so any task failure will lead to job
failure
+ testRestartBackoffTimeStrategy.setCanRestart(false);
+ final DefaultScheduler scheduler =
createSchedulerAndStartScheduling(jobGraph);
+
+ final ArchivedExecutionVertex archivedExecutionVertex =
Iterables.getOnlyElement(scheduler.requestJob().getAllExecutionVertices());
+ final ExecutionAttemptID attemptId =
archivedExecutionVertex.getCurrentExecutionAttempt().getAttemptId();
+
+ scheduler.updateTaskExecutionState(new
TaskExecutionState(jobGraph.getJobID(), attemptId, ExecutionState.FAILED));
Review comment:
I think the test can be simplified by directly calling
```
scheduler.failJob(new FlinkException("Test failure."));
```
----------------------------------------------------------------
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