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 new failure comes while the failover region is in CANCELLING
	 * @throws Exception
	 */
Tests that a new failure comes while the failover region is in CANCELLING
@throws Exception
Tests that a new failure comes while the failover region is in CANCELLING @throws Exception
@Test
	public void testFailWhileCancelling() throws Exception {
		RestartStrategy restartStrategy = new InfiniteDelayRestartStrategy();
		ExecutionGraph eg = createSingleRegionExecutionGraph(restartStrategy);
		RestartPipelinedRegionStrategy strategy = (RestartPipelinedRegionStrategy)eg.getFailoverStrategy();
		Iterator<ExecutionVertex> iter = eg.getAllExecutionVertices().iterator();
		ExecutionVertex ev1 = iter.next();
		ev1.getCurrentExecutionAttempt().switchToRunning();
		assertEquals(JobStatus.RUNNING, strategy.getFailoverRegion(ev1).getState());
		ev1.getCurrentExecutionAttempt().fail(new Exception("new fail"));
		assertEquals(JobStatus.CANCELLING, strategy.getFailoverRegion(ev1).getState());
		ExecutionVertex ev2 = iter.next();
		ev2.getCurrentExecutionAttempt().fail(new Exception("new fail"));
		assertEquals(JobStatus.RUNNING, eg.getState());
		assertEquals(JobStatus.CANCELLING, strategy.getFailoverRegion(ev1).getState());
	}
@ Test public void testFailWhileCancelling ( ) throws Exception { RestartStrategy restartStrategy = new InfiniteDelayRestartStrategy ( ) ; ExecutionGraph eg = createSingleRegionExecutionGraph ( restartStrategy ) ; RestartPipelinedRegionStrategy strategy = ( RestartPipelinedRegionStrategy ) eg . getFailoverStrategy ( ) ; Iterator < ExecutionVertex > iter = eg . getAllExecutionVertices ( ) . iterator ( ) ; ExecutionVertex ev1 = iter . next ( ) ; ev1 . getCurrentExecutionAttempt ( ) . switchToRunning ( ) ; assertEquals ( JobStatus . RUNNING , strategy . getFailoverRegion ( ev1 ) . getState ( ) ) ; ev1 . getCurrentExecutionAttempt ( ) . fail ( new Exception ( "new fail" ) ) ; assertEquals ( JobStatus . CANCELLING , strategy . getFailoverRegion ( ev1 ) . getState ( ) ) ; ExecutionVertex ev2 = iter . next ( ) ; ev2 . getCurrentExecutionAttempt ( ) . fail ( new Exception ( "new fail" ) ) ; assertEquals ( JobStatus . RUNNING , eg . getState ( ) ) ; assertEquals ( JobStatus . CANCELLING , strategy . getFailoverRegion ( ev1 ) . getState ( ) ) ; }
Tests that a new failure comes while the failover region is in CANCELLING
 @throws Exception
Tests that a new failure comes while the failover region is in CANCELLING @throws Exception