You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "lidavidm (via GitHub)" <gi...@apache.org> on 2023/02/02 00:49:24 UTC

[GitHub] [arrow] lidavidm commented on a diff in pull request #33992: GH-33993: [Java] Let OS assign port in tests while creating Flight server

lidavidm commented on code in PR #33992:
URL: https://github.com/apache/arrow/pull/33992#discussion_r1093893857


##########
java/flight/flight-core/src/test/java/org/apache/arrow/flight/FlightTestUtil.java:
##########
@@ -51,7 +52,10 @@ public static <T> T getStartedServer(Function<Location, T> newServerFromLocation
     IOException lastThrown = null;
     T server = null;
     for (int x = 0; x < 3; x++) {
-      final int port = 49152 + RANDOM.nextInt(5000);
+      final ServerSocket dynamicPortSocket = new ServerSocket(0);

Review Comment:
   nit: maybe try-with-resources this just to be safe?



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org