flink-instrumentation/workspace/flink-1.4.1-instrumented/flink-1.4.1/flink-runtime/src/test/java/org/apache/flink/runtime/resourcemanager/ResourceManagerTaskExecutorTest.java
/**
	 * Test receive registration with unmatched leadershipId from task executor
	 */
Test receive registration with unmatched leadershipId from task executor
Test receive registration with unmatched leadershipId from task executor
@Test
	public void testRegisterTaskExecutorWithUnmatchedLeaderSessionId() throws Exception {
		try {
			CompletableFuture<RegistrationResponse> unMatchedLeaderFuture =
				wronglyFencedGateway.registerTaskExecutor(taskExecutorAddress, taskExecutorResourceID, slotReport, timeout);
			try {
				unMatchedLeaderFuture.get(timeout.toMilliseconds(), TimeUnit.MILLISECONDS);
				fail("Should have failed because we are using a wrongly fenced ResourceManagerGateway.");
			} catch (ExecutionException e) {
				assertTrue(ExceptionUtils.stripExecutionException(e) instanceof FencingTokenException);
			}
		} finally {
			if (testingFatalErrorHandler.hasExceptionOccurred()) {
				testingFatalErrorHandler.rethrowError();
			}
		}
	}
@ Test public void testRegisterTaskExecutorWithUnmatchedLeaderSessionId ( ) throws Exception { try { CompletableFuture < RegistrationResponse > unMatchedLeaderFuture = wronglyFencedGateway . registerTaskExecutor ( taskExecutorAddress , taskExecutorResourceID , slotReport , timeout ) ; try { unMatchedLeaderFuture . get ( timeout . toMilliseconds ( ) , TimeUnit . MILLISECONDS ) ; fail ( "Should have failed because we are using a wrongly fenced ResourceManagerGateway." ) ; } catch ( ExecutionException e ) { assertTrue ( ExceptionUtils . stripExecutionException ( e ) instanceof FencingTokenException ) ; } } finally { if ( testingFatalErrorHandler . hasExceptionOccurred ( ) ) { testingFatalErrorHandler . rethrowError ( ) ; } } }
Test receive registration with unmatched leadershipId from task executor
Test receive registration with unmatched leadershipId from task executor
// test throw exception when receive a registration from taskExecutor which takes unmatched leaderSessionId