RFR: 8310645: CancelledResponse.java does not use HTTP/2 when testing the HttpClient

Daniel Fuchs dfuchs at openjdk.org
Tue Jul 4 13:20:56 UTC 2023


On Tue, 4 Jul 2023 09:40:23 GMT, Conor Cleary <ccleary at openjdk.org> wrote:

>> test/jdk/java/net/httpclient/CancelledResponse2.java line 228:
>> 
>>> 226:                 cancelled.set(true);
>>> 227:                 subscription.cancel();
>>> 228:                 result.completeExceptionally(new CancelException());
>> 
>> I believe that's the exception we expect to find in the `HttpResponse`. IIRC the original test was checking for that.
>
> Right, but calling `subscription.cancel()` causes `Stream.cancelImpl()` to be called. That in turn causes the `HttpResponse` (or the variable result in your snippet above) to complete exceptionally with an IOException which has the message "Stream x cancelled". I think that means that the call to `completeExceptionally(new CancelException())` has no effect because `subscription.cancel()` triggers a call to `cancelImpl()`

OK. LGTM then.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14625#discussion_r1252020736


More information about the net-dev mailing list