On Tue, 7 Jul 2026 14:13:44 GMT, Daniel Fuchs <[email protected]> wrote:
>> Benjamin Peterson has updated the pull request with a new target base due to
>> a merge or a rebase. The incremental webrev excludes the unrelated changes
>> brought in by the merge/rebase. The pull request contains five additional
>> commits since the last revision:
>>
>> - sharpen testPostSendAsync assertion like testGetSendAsync
>> - add assert isDone
>> - add testCancel
>> - Merge branch 'master' into httpclient-cancel-race
>> - 8380967: Canceled HttpClient.sendAsync futures throw inconsistent
>> exceptions
>>
>> Make `MinimalFuture` cancelation atomic. This prevents HTTP request
>> cancelation logic from racily completing the future with an error.
>
> test/jdk/java/net/httpclient/CancelRequestTest.java line 401:
>
>> 399: } catch (CancellationException x) {
>> 400: out.println(now() + "Got expected exception: " + x);
>> 401: }
>
> Hmmm... Wouldn't it be better and clearer if we used
> `assertThrows(CancellationException.class, cf1::get)` here (and below in POST
> too)?
>
> What do you think?
We could also assertTrue(cf1.isCancelled()); after this.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/31758#discussion_r3537168160