flink-instrumentation/workspace/flink-1.4.1-instrumented/flink-1.4.1/flink-runtime/src/test/java/org/apache/flink/runtime/rpc/akka/AkkaRpcActorTest.java
/**
	 * Tests that actors are properly terminated when the AkkaRpcService is shut down.
	 */
Tests that actors are properly terminated when the AkkaRpcService is shut down.
Tests that actors are properly terminated when the AkkaRpcService is shut down .
@Test
	public void testActorTerminationWhenServiceShutdown() throws Exception {
		final ActorSystem rpcActorSystem = AkkaUtils.createDefaultActorSystem();
		final RpcService rpcService = new AkkaRpcService(rpcActorSystem, timeout);
		try {
			SimpleRpcEndpoint rpcEndpoint = new SimpleRpcEndpoint(rpcService, SimpleRpcEndpoint.class.getSimpleName());
			rpcEndpoint.start();
			CompletableFuture<Boolean> terminationFuture = rpcEndpoint.getTerminationFuture();
			rpcService.stopService();
			terminationFuture.get(timeout.toMilliseconds(), TimeUnit.MILLISECONDS);
		} finally {
			rpcActorSystem.shutdown();
			rpcActorSystem.awaitTermination(FutureUtils.toFiniteDuration(timeout));
		}
	}
@ Test public void testActorTerminationWhenServiceShutdown ( ) throws Exception { final ActorSystem rpcActorSystem = AkkaUtils . createDefaultActorSystem ( ) ; final RpcService rpcService = new AkkaRpcService ( rpcActorSystem , timeout ) ; try { SimpleRpcEndpoint rpcEndpoint = new SimpleRpcEndpoint ( rpcService , SimpleRpcEndpoint . class . getSimpleName ( ) ) ; rpcEndpoint . start ( ) ; CompletableFuture < Boolean > terminationFuture = rpcEndpoint . getTerminationFuture ( ) ; rpcService . stopService ( ) ; terminationFuture . get ( timeout . toMilliseconds ( ) , TimeUnit . MILLISECONDS ) ; } finally { rpcActorSystem . shutdown ( ) ; rpcActorSystem . awaitTermination ( FutureUtils . toFiniteDuration ( timeout ) ) ; } }
Tests that actors are properly terminated when the AkkaRpcService is shut down.
Tests that actors are properly terminated when the AkkaRpcService is shut down .