On Tue, 3 Nov 2026 10:02:45 GMT, Volkan Yazici <[email protected]> wrote:
>> The part that I am uncertain about in this line is, why would >> `connectAndWriteRequest()` complete normally sometimes and on other >> occassions fail with a `SocketException`. In other words, would the test >> work as expected if it was changed to: >> >> connectAndWriteRequest(server.getAddress(), lastSocket, "/?socket=last"); >> assertEquals(-1, lastSocket.getInputStream().read(), "did not receive EOF"); > >> The part that I am uncertain about in this line is, why would >> `connectAndWriteRequest()` complete normally sometimes and on other >> occassions fail with a `SocketException`. > > It is a timing issue. Sometimes the server is quick enough to reject the > request and close the connection before client finishes write & flush, > sometimes it is not. > >> In other words, would the test work as expected if it was changed to: >> >> connectAndWriteRequest(server.getAddress(), lastSocket, "/?socket=last"); >> assertEquals(-1, lastSocket.getInputStream().read(), "did not receive EOF"); > > Yes. This will too. Would you prefer me using that? Changed in 34156fd7d88. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/31974#discussion_r4467703159
