GJL commented on a change in pull request #8972: [FLINK-13060][coordination] 
Respect restart constraints in new RegionFailover strategy
URL: https://github.com/apache/flink/pull/8972#discussion_r300244942
 
 

 ##########
 File path: 
flink-runtime/src/test/java/org/apache/flink/runtime/executiongraph/AdaptedRestartPipelinedRegionStrategyNGFailoverTest.java
 ##########
 @@ -248,6 +253,45 @@ public void testNoRestart() throws Exception {
                assertEquals(JobStatus.FAILED, eg.getState());
        }
 
+       /**
+        * Tests that the execution of the restart logic of the failover 
strategy is dependent on the restart strategy
+        * calling {@link RestartCallback#triggerFullRecovery()}.
+        */
+       @Test
+       public void 
testFailoverExecutionDependentOnRestartStrategyRecoveryTrigger() throws 
Exception {
+               final JobGraph jobGraph = createBatchJobGraph();
+               final CompletableFuture<Void> restartCallFuture = new 
CompletableFuture<>();
+               final RestartStrategy restartStrategy = new RestartStrategy() {
+                       @Override
+                       public boolean canRestart() {
+                               return true;
+                       }
+
+                       @Override
+                       public void restart(RestartCallback restarter, 
ScheduledExecutor executor) {
+                               restartCallFuture.complete(null);
+                       }
+               };
+               final ExecutionGraph eg = createExecutionGraph(jobGraph, 
restartStrategy);
+
+               final ExecutionVertex ev = 
eg.getAllExecutionVertices().iterator().next();
+
+               ev.fail(new Exception("Test Exception"));
+
+               manualMainThreadExecutor.triggerAll();
+
+               // the entire failover-procedure is being halted by the restart 
strategy not doing anything
+               // the only thing the failover strategy should do is cancel 
tasks that require it
+
+               // sanity check to ensure we actually called into the restart 
strategy
+               assertEquals(restartCallFuture.isDone(),true);
 
 Review comment:
   space after `,` missing

----------------------------------------------------------------
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

Reply via email to