You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "abmo-x (via GitHub)" <gi...@apache.org> on 2023/02/21 19:49:53 UTC

[GitHub] [iceberg] abmo-x commented on a diff in pull request #6895: Core: use random port for rest catalog unit tests

abmo-x commented on code in PR #6895:
URL: https://github.com/apache/iceberg/pull/6895#discussion_r1113504174


##########
core/src/test/java/org/apache/iceberg/rest/TestRESTCatalog.java:
##########
@@ -150,7 +154,8 @@ public <T extends RESTResponse> T execute(
     servletContext.setVirtualHosts(null);
     servletContext.setGzipHandler(new GzipHandler());
 
-    this.httpServer = new Server(8181);
+    initializePort();
+    this.httpServer = new Server(port);

Review Comment:
   I think the chances of that happening are pretty low as the binding port is determined by the kernel randomly from available ports. It can happen but very low as all this is happening is nano seconds at the kernel to pick a socket,  close it and then start the rest server at that port.
   
   I think this is better than having it hard coded to 8181 as we know our CI build fails due to parallel runs 



-- 
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: issues-unsubscribe@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org