TisonKun commented on a change in pull request #7927: [FLINK-11603][metrics] 
Port the MetricQueryService to the new RpcEndpoint
URL: https://github.com/apache/flink/pull/7927#discussion_r268373575
 
 

 ##########
 File path: 
flink-runtime/src/test/java/org/apache/flink/runtime/metrics/MetricRegistryImplTest.java
 ##########
 @@ -369,21 +367,17 @@ public void testQueryActorShutdown() throws Exception {
 
                MetricRegistryImpl registry = new 
MetricRegistryImpl(MetricRegistryConfiguration.defaultMetricRegistryConfiguration());
 
-               final ActorSystem actorSystem = 
AkkaUtils.createDefaultActorSystem();
+               final RpcService rpcService = new TestingRpcService();
 
-               registry.startQueryService(actorSystem, null);
+               registry.startQueryService(rpcService, null);
 
-               ActorRef queryServiceActor = registry.getQueryService();
+               MetricQueryService queryService = 
checkNotNull(registry.getQueryService());
 
                registry.shutdown().get();
 
-               try {
-                       
Await.result(actorSystem.actorSelection(queryServiceActor.path()).resolveOne(timeout),
 timeout);
+               queryService.getTerminationFuture().get(timeout.toMillis(), 
TimeUnit.MILLISECONDS);
 
-                       fail("The query actor should be terminated resulting in 
a ActorNotFound exception.");
-               } catch (ActorNotFound e) {
-                       // we expect the query actor to be shut down
-               }
+               rpcService.stopService();
 
 Review comment:
   You're right that the registry supposed to shut it down. Remove this line.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to