On Wed, 26 Aug 2026 19:39:47 GMT, Volkan Yazici <[email protected]> wrote:

>> Lee Jiwon has refreshed the contents of this pull request, and previous 
>> commits have been removed. The incremental views will show differences 
>> compared to the previous content of the PR. The pull request contains one 
>> new commit since the last revision:
>> 
>>   8390064: Stabilize IsAvailable test
>
> test/jdk/sun/net/www/http/HttpClient/IsAvailable.java line 188:
> 
>> 186:         }
>> 187: 
>> 188:         private static MethodHandle findServerSocketAccessor() {
> 
> Similar to `findAvailableAccessor()`, can you make this method return a 
> `Function<HttpClient,Socket>`, please? This avoids leaking the `MethodHandle` 
> internal detail.

Updated the accessor to return `Function<HttpClient, Socket>`.

> test/jdk/sun/net/www/http/HttpClient/IsAvailable.java line 238:
> 
>> 236: 
>> 237:         private void awaitEof() throws IOException {
>> 238:             assertEquals(-1, readFromHttpClientSocket(),
> 
> This is only used at one place. Instead of defining a new method, just inline 
> this `assertEquals()` at the call-site.

Inlined the assertion in `testClosedSocket()` and removed `awaitEof()`.

> test/jdk/sun/net/www/http/HttpClient/IsAvailable.java line 246:
> 
>> 244:             int timeout = socket.getSoTimeout();
>> 245:             try {
>> 246:                 socket.setSoTimeout((int) adjustTimeout(500));
> 
> Tests run on several of platforms with varying configurations. I suggest 
> relaxing this wait time to 5s:
> 
> Suggestion:
> 
>                 socket.setSoTimeout((int) adjustTimeout(5000));
> 
> 
> On the happy path, `socket.getInputStream().read()` should complete in a 
> couple of milliseconds. SO timeout just establishes a limit.

Updated to `adjustTimeout(5000)`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/32539#discussion_r3871763680
PR Review Comment: https://git.openjdk.org/jdk/pull/32539#discussion_r3871764226
PR Review Comment: https://git.openjdk.org/jdk/pull/32539#discussion_r3871764671

Reply via email to