flink-instrumentation/workspace/flink-1.4.1-instrumented/flink-1.4.1/flink-runtime/src/test/java/org/apache/flink/runtime/executiongraph/FailoverRegionTest.java
/**
	 * Tests that a job only has one failover region and can recover from task failure successfully
	 * @throws Exception
	 */
Tests that a job only has one failover region and can recover from task failure successfully
@throws Exception
Tests that a job only has one failover region and can recover from task failure successfully @throws Exception
@Test
	public void testSingleRegionFailover() throws Exception {
		RestartStrategy restartStrategy = new InfiniteDelayRestartStrategy(10);
		ExecutionGraph eg = createSingleRegionExecutionGraph(restartStrategy);
		RestartPipelinedRegionStrategy strategy = (RestartPipelinedRegionStrategy)eg.getFailoverStrategy();
		ExecutionVertex ev = eg.getAllExecutionVertices().iterator().next();
		assertEquals(JobStatus.RUNNING, strategy.getFailoverRegion(ev).getState());
		ev.getCurrentExecutionAttempt().fail(new Exception("Test Exception"));
		assertEquals(JobStatus.CANCELLING, strategy.getFailoverRegion(ev).getState());
		for (ExecutionVertex evs : eg.getAllExecutionVertices()) {
			evs.getCurrentExecutionAttempt().cancelingComplete();
		}
		assertEquals(JobStatus.RUNNING, strategy.getFailoverRegion(ev).getState());
	}
@ Test public void testSingleRegionFailover ( ) throws Exception { RestartStrategy restartStrategy = new InfiniteDelayRestartStrategy ( 10 ) ; ExecutionGraph eg = createSingleRegionExecutionGraph ( restartStrategy ) ; RestartPipelinedRegionStrategy strategy = ( RestartPipelinedRegionStrategy ) eg . getFailoverStrategy ( ) ; ExecutionVertex ev = eg . getAllExecutionVertices ( ) . iterator ( ) . next ( ) ; assertEquals ( JobStatus . RUNNING , strategy . getFailoverRegion ( ev ) . getState ( ) ) ; ev . getCurrentExecutionAttempt ( ) . fail ( new Exception ( "Test Exception" ) ) ; assertEquals ( JobStatus . CANCELLING , strategy . getFailoverRegion ( ev ) . getState ( ) ) ; for ( ExecutionVertex evs : eg . getAllExecutionVertices ( ) ) { evs . getCurrentExecutionAttempt ( ) . cancelingComplete ( ) ; } assertEquals ( JobStatus . RUNNING , strategy . getFailoverRegion ( ev ) . getState ( ) ) ; }
Tests that a job only has one failover region and can recover from task failure successfully
 @throws Exception
Tests that a job only has one failover region and can recover from task failure successfully @throws Exception