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 normal registration from task executor and receive duplicate registration from task executor
	 */
Test receive normal registration from task executor and receive duplicate registration from task executor
Test receive normal registration from task executor and receive duplicate registration from task executor
@Test
	public void testRegisterTaskExecutor() throws Exception {
		try {
			CompletableFuture<RegistrationResponse> successfulFuture =
				rmGateway.registerTaskExecutor(taskExecutorAddress, taskExecutorResourceID, slotReport, timeout);
			RegistrationResponse response = successfulFuture.get(timeout.toMilliseconds(), TimeUnit.MILLISECONDS);
			assertTrue(response instanceof TaskExecutorRegistrationSuccess);
			 with instanceID not equal to previous when receive duplicate registration from taskExecutor
			CompletableFuture<RegistrationResponse> duplicateFuture =
				rmGateway.registerTaskExecutor(taskExecutorAddress, taskExecutorResourceID, slotReport, timeout);
			RegistrationResponse duplicateResponse = duplicateFuture.get();
			assertTrue(duplicateResponse instanceof TaskExecutorRegistrationSuccess);
			assertNotEquals(((TaskExecutorRegistrationSuccess) response).getRegistrationId(), ((TaskExecutorRegistrationSuccess) duplicateResponse).getRegistrationId());
		} finally {
			if (testingFatalErrorHandler.hasExceptionOccurred()) {
				testingFatalErrorHandler.rethrowError();
			}
		}
	}
@ Test public void testRegisterTaskExecutor ( ) throws Exception { try { CompletableFuture < RegistrationResponse > successfulFuture = rmGateway . registerTaskExecutor ( taskExecutorAddress , taskExecutorResourceID , slotReport , timeout ) ; RegistrationResponse response = successfulFuture . get ( timeout . toMilliseconds ( ) , TimeUnit . MILLISECONDS ) ; assertTrue ( response instanceof TaskExecutorRegistrationSuccess ) ; CompletableFuture < RegistrationResponse > duplicateFuture = rmGateway . registerTaskExecutor ( taskExecutorAddress , taskExecutorResourceID , slotReport , timeout ) ; RegistrationResponse duplicateResponse = duplicateFuture . get ( ) ; assertTrue ( duplicateResponse instanceof TaskExecutorRegistrationSuccess ) ; assertNotEquals ( ( ( TaskExecutorRegistrationSuccess ) response ) . getRegistrationId ( ) , ( ( TaskExecutorRegistrationSuccess ) duplicateResponse ) . getRegistrationId ( ) ) ; } finally { if ( testingFatalErrorHandler . hasExceptionOccurred ( ) ) { testingFatalErrorHandler . rethrowError ( ) ; } } }
Test receive normal registration from task executor and receive duplicate registration from task executor
Test receive normal registration from task executor and receive duplicate registration from task executor
// test response successful // test response successful with instanceID not equal to previous when receive duplicate registration from taskExecutor