On Wed, 27 Nov 2024 14:34:32 GMT, Volkan Yazıcı <d...@openjdk.org> wrote:

>> This PR, addressing 8343791, changes `Socket::connect()` methods to close 
>> the `Socket` in the event that the connection cannot be established, the 
>> timeout expires before the connection is established, or the socket address 
>> is unresolved.
>> 
>> `tier3` tests pass against the 9f00f61d3b7fa42a5e23a04f80bb4bb1a2076ef2.
>
> 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())

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22160#discussion_r1860940688

Reply via email to