RFR: 8330814: Cleanups for KeepAliveCache tests [v2]
Jaikiran Pai
jpai at openjdk.org
Wed Apr 24 06:47:29 UTC 2024
On Tue, 23 Apr 2024 08:39:56 GMT, Christoph Langer <clanger at openjdk.org> wrote:
>> While working in that area I found some potential for cleanup of a few tests.
>>
>> Most notably:
>>
>> B5045306.java:
>> - does not need to run in othervm
>> - the executor service that it uses should be shut down eventually to free resources
>>
>> B8291637.java:
>> - use just one instead of two test VM invocations
>> KeepAliveTimerThread.java:
>> call to grp.destroy() at the end is pointless (API is void & deprecated for removal)
>>
>> Generally:
>> The deprecated URL constructor is used. It can be switched to the handy URIBuilder
>> Some more try with resources here and there
>
> Christoph Langer has updated the pull request incrementally with one additional commit since the last revision:
>
> Update test/jdk/sun/net/www/http/KeepAliveCache/B5045306.java
>
> Co-authored-by: Andrey Turbanov <turbanoff at gmail.com>
test/jdk/sun/net/www/http/KeepAliveCache/B8291637.java line 142:
> 140: .port(port)
> 141: .path("/firstCall")
> 142: .toURL();
Hello Christoph, what's the significance of changing the path from `/` to `/firstCall` in this test?
test/jdk/sun/net/www/http/KeepAliveCache/B8291637.java line 148:
> 146: int c;
> 147: byte[] buf = new byte[256];
> 148: while ((c=i.read(buf)) != -1) {
Nit: needs a space before and after the `=`
test/jdk/sun/net/www/http/KeepAliveCache/B8291637.java line 149:
> 147: byte[] buf = new byte[256];
> 148: while ((c=i.read(buf)) != -1) {
> 149: count+=c;
Same here, needs a space before/after `+=`
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18884#discussion_r1577359424
PR Review Comment: https://git.openjdk.org/jdk/pull/18884#discussion_r1577360405
PR Review Comment: https://git.openjdk.org/jdk/pull/18884#discussion_r1577360693
More information about the net-dev
mailing list