zentol commented on a change in pull request #18334:
URL: https://github.com/apache/flink/pull/18334#discussion_r782904247



##########
File path: 
flink-runtime/src/test/java/org/apache/flink/runtime/io/network/netty/NettyConnectionManagerTest.java
##########
@@ -111,18 +116,20 @@ public void testManualConfiguration() throws Exception {
         
flinkConfig.setInteger(NettyShuffleEnvironmentOptions.NUM_THREADS_CLIENT, 3);
         
flinkConfig.setInteger(NettyShuffleEnvironmentOptions.NUM_THREADS_SERVER, 4);
 
-        NettyConfig config =
-                new NettyConfig(
-                        InetAddress.getLocalHost(),
-                        NetUtils.getAvailablePort(),
-                        1024,
-                        1337,
-                        flinkConfig);
+        NettyConnectionManager connectionManager;
+        try (NetUtils.Port port = NetUtils.getAvailablePort()) {
 
-        NettyConnectionManager connectionManager = 
createNettyConnectionManager(config);
-        connectionManager.start();
+            NettyConfig config =
+                    new NettyConfig(
+                            InetAddress.getLocalHost(), port.getPort(), 1024, 
1337, flinkConfig);

Review comment:
       This one also works with port 0...




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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to