RFR: 8206187: javax/management/remote/mandatory/connection/DefaultAgentFilterTest.java fails with Port already in use

Kevin Walls kevinw at openjdk.java.net
Thu Feb 24 10:33:05 UTC 2022


On Wed, 23 Feb 2022 17:19:16 GMT, Mark Sheppard <msheppar at openjdk.org> wrote:

> An alternative is to use a fixed port 1098

Thanks Mark - I will avoid that fixed slot as we no doubt run tests concurrently, and also in case these get backported far enough that it's not free. 8-)

Utils.getFreePort() lets new ServerSocket choose a port,  but there's clearly a race to use it.  We could make it simply random, but I think we need still need to retry like this to avoid failures --  will monitor and see how the race goes with 10 attempts.

-------------

PR: https://git.openjdk.java.net/jdk/pull/7589


More information about the serviceability-dev mailing list