xintongsong commented on a change in pull request #15411:
URL: https://github.com/apache/flink/pull/15411#discussion_r604547989



##########
File path: 
flink-runtime/src/test/java/org/apache/flink/runtime/rpc/RpcEndpointTest.java
##########
@@ -262,4 +267,136 @@ protected ExtendedEndpoint(
             return CompletableFuture.completedFuture(isRunning());
         }
     }
+
+    /**
+     * Tests that the {@link RpcEndpoint} can execute the runnable. See also 
{@link
+     * org.apache.flink.runtime.rpc.RpcEndpoint#runAsync(Runnable)}
+     */
+    @Test
+    public void testRunAsync() throws InterruptedException, 
ExecutionException, TimeoutException {
+        RpcEndpoint dummyRpcEndpoint = new RpcEndpoint(rpcService) {};
+        final OneShotLatch latch = new OneShotLatch();
+        try {
+            dummyRpcEndpoint.start();
+            dummyRpcEndpoint.runAsync(latch::trigger);

Review comment:
       One of the most important contract of the scheduling methods is that, 
the scheduled command must be executed in the RPC main thread. I think we 
should also verify that in the test.
   
   Same for other tests.




-- 
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


Reply via email to