On Thu, 7 Nov 2024 11:06:20 GMT, Daniel Jeliński <djelin...@openjdk.org> wrote:
> This PR fixes an intermittent test failure on Windows. The test server used > in HttpURLConnectionExpect100Test now reads from the socket until the client > closes it. > > The current implementation closes the server socket after reading the request > headers, but without reading the request body. On Windows, if any data is > left in the socket receive buffer when the socket is closed, the connection > is reset. If the client doesn't read the response before the connection is > reset, the response is lost and the test fails. > > Verified that: > - the test still passes > - waiting for the client to close the socket does not take excessive amounts > of time (the test finishes in half a second on my machine) Looks reasonable to me. Plus good cleanup with try-with-resources! ------------- Marked as reviewed by dfuchs (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/21948#pullrequestreview-2420797689