zhuzhurk commented on a change in pull request #9778: [FLINK-14206][runtime]
Let fullRestart metric count both full restarts and fine grained restarts
URL: https://github.com/apache/flink/pull/9778#discussion_r335259999
##########
File path:
flink-runtime/src/test/java/org/apache/flink/runtime/executiongraph/AdaptedRestartPipelinedRegionStrategyNGFailoverTest.java
##########
@@ -294,6 +294,44 @@ public void testFailGlobalIfErrorOnRestartTasks() throws
Exception {
assertNotEquals(globalModVersionBeforeFailure,
globalModVersionAfterFailure);
}
+ @Test
+ public void testCountingRestarts() throws Exception {
+ final JobGraph jobGraph = createStreamingJobGraph();
+ final ExecutionGraph eg = createExecutionGraph(jobGraph);
+
+ final Iterator<ExecutionVertex> vertexIterator =
eg.getAllExecutionVertices().iterator();
+ final ExecutionVertex ev11 = vertexIterator.next();
+ final ExecutionVertex ev12 = vertexIterator.next();
+ final ExecutionVertex ev21 = vertexIterator.next();
+ final ExecutionVertex ev22 = vertexIterator.next();
+
+ // trigger task failure of ev11, vertices { ev11, ev21 } should
be affected
+ ev11.getCurrentExecutionAttempt().fail(new Exception("Test
Exception"));
+ assertEquals(1, eg.getNumberOfRestarts());
+
+ // finish the failover
+ manualMainThreadExecutor.triggerAll();
+ manualMainThreadExecutor.triggerScheduledTasks();
+ ev21.getCurrentExecutionAttempt().completeCancelling();
+ manualMainThreadExecutor.triggerAll();
+ manualMainThreadExecutor.triggerScheduledTasks();
+
+ // trigger task failure of ev12, vertices { ev12, ev22 } should
be affected
Review comment:
You are right. The test can simplified.
----------------------------------------------------------------
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