RFR: 8330814: Cleanups for KeepAliveCache tests
    Andrey Turbanov 
    aturbanov at openjdk.org
       
    Tue Apr 23 08:10:29 UTC 2024
    
    
  
On Mon, 22 Apr 2024 11:06:57 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
test/jdk/sun/net/www/http/KeepAliveCache/B5045306.java line 143:
> 141:             ThreadInfo[] threadInfo = threadMXBean.getThreadInfo(threads);
> 142:             for (int i=0; i<threadInfo.length; i++) {
> 143:                 if (threadInfo[i].getThreadName().equals("Keep-Alive-SocketCleaner"))  {
Suggestion:
                if (threadInfo[i].getThreadName().equals("Keep-Alive-SocketCleaner")) {
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18884#discussion_r1575829443
    
    
More information about the net-dev
mailing list