rkhachatryan commented on a change in pull request #13778:
URL: https://github.com/apache/flink/pull/13778#discussion_r511639081



##########
File path: 
flink-runtime/src/test/java/org/apache/flink/runtime/io/network/netty/PartitionRequestClientFactoryTest.java
##########
@@ -61,15 +61,23 @@
 
        @Test
        public void testInterruptsNotCached() throws Exception {
-               ConnectionID connectionId = new ConnectionID(new 
InetSocketAddress(InetAddress.getLocalHost(), 8080), 0);
-               try (AwaitingNettyClient nettyClient = new 
AwaitingNettyClient()) {
+               final NettyTestUtil.NettyServerAndClient nettyServerAndClient = 
createNettyServerAndClient();
+               ConnectionID connectionId = new ConnectionID(new 
InetSocketAddress(
+                       
nettyServerAndClient.server().getConfig().getServerAddress(),
+                       
nettyServerAndClient.server().getConfig().getServerPort()),
+                       0);
+               try {
+                       AwaitingNettyClient nettyClient = new 
AwaitingNettyClient(nettyServerAndClient.client());
                        PartitionRequestClientFactory factory = new 
PartitionRequestClientFactory(nettyClient, 0);
 
                        nettyClient.awaitForInterrupts = true;
                        connectAndInterrupt(factory, connectionId);
 
                        nettyClient.awaitForInterrupts = false;
                        factory.createPartitionRequestClient(connectionId);
+               } finally {
+                       nettyServerAndClient.client().shutdown();
+                       nettyServerAndClient.server().shutdown();
                }

Review comment:
       The part "`client` wrapping `serverAndClient`"
   would still hold (and I'd like to avoid it).
   
   Why do you want to stick with the current way?




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