On Wed, 27 Nov 2024 16:16:07 GMT, Daniel Fuchs <[email protected]> wrote:
>> Volkan Yazıcı has updated the pull request incrementally with two additional
>> commits since the last revision:
>>
>> - Replace complex JUnit machinery with native Java
>> - Remove tests using mocks
>
> test/jdk/java/net/Socket/ServerSocketTestUtil.java line 39:
>
>> 37: static void withEphemeralServerSocket(ThrowingConsumer<ServerSocket>
>> serverSocketConsumer) throws Exception {
>> 38: try (ExecutorService executorService =
>> Executors.newVirtualThreadPerTaskExecutor();
>> 39: ServerSocket serverSocket = new ServerSocket(0)) {
>
> I'd suggest making sure the server binds to the loopback address. Using the
> wildcard address is a know source of instabilities in tests.
>
>
> new ServerSocket(0, 0, InetAddress.getLoopbackAddress())
Thanks for the tip! Fixed in c8bc5a3e4c9c77b4e954019cdd9ecd6095eb1e4b.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22160#discussion_r1861709825