RFR: 8376118: java/net/httpclient/StreamingBody.java fails intermittently on Windows [v3]
Daniel Fuchs
dfuchs at openjdk.org
Fri Jan 23 10:31:16 UTC 2026
On Fri, 23 Jan 2026 08:49:06 GMT, Volkan Yazici <vyazici at openjdk.org> wrote:
>> Daniel Fuchs has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Update test/jdk/java/net/httpclient/StreamingBody.java
>>
>> Co-authored-by: Volkan Yazıcı <volkan.yazici at oracle.com>
>
> test/jdk/java/net/httpclient/StreamingBody.java line 103:
>
>> 101: long nan = now % 1000_000;
>> 102: return String.format("[%d s, %d ms, %d ns] ", secs, mill, nan);
>> 103: }
>
> *Nit:* You can also be done with just `import static java.time.Instant.now`.
The goal here is to give a human-friendly approximation of the elapsed time since the test started, with seconds, millis, nanos. Instant is the wall clock so I'd rather not use that.
> test/jdk/java/net/httpclient/StreamingBody.java line 226:
>
>> 224: .build()
>> 225: .sendAsync(request, BodyHandlers.ofInputStream())
>> 226: .join();
>
> Any particular reason we prefer `sendAsync().join()` over `send()`?
Yes. we want to relinquish the reference to the HttpClient facade as soon as possible.
> test/jdk/java/net/httpclient/StreamingBody.java line 313:
>
>> 311: }
>> 312:
>> 313: static class MessageHandler implements HttpTestHandler {
>
> You can replace this class with `EchoHandler`.
Maybe in future work.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/29366#discussion_r2720616913
PR Review Comment: https://git.openjdk.org/jdk/pull/29366#discussion_r2720621950
PR Review Comment: https://git.openjdk.org/jdk/pull/29366#discussion_r2720630244
More information about the net-dev
mailing list