RFR: 7903373: Add ability to customize test execution using main wrapper plugin [v17]

Leonid Mesnik lmesnik at openjdk.org
Sat Feb 25 00:34:06 UTC 2023


On Fri, 24 Feb 2023 23:30:00 GMT, Jonathan Gibbons <jjg at openjdk.org> wrote:

>> Leonid Mesnik has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 59 commits:
>> 
>>  - merge
>>  - CHANGELOG.md updated
>>  - Renamed TestThreadFactoryProvider.java
>>  - fixed i28n
>>  - Updated plugin to implement standard ThreadFactory.
>>  - removed spaces
>>  - updated docs and copyrights
>>  - Added new file.
>>  - Renamed MainWrapper to TestThreadFactory.
>>  - removed DriverTest.java
>>  - ... and 49 more: https://git.openjdk.org/jtreg/compare/2f5f2693...f4e9cc63
>
> src/share/classes/com/sun/javatest/regtest/agent/TestThreadFactoryHelper.java line 68:
> 
>> 66:             }
>> 67:             loader = new URLClassLoader(urls.toArray(new URL[urls.size()]), loader);
>> 68:         }
> 
> In the `othervm` case, this code will presumably just be called once, but in the `agentvm` case, won't it be called once per test, and since the class loader is never closed, (see [URLCLassLoader.close](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/net/URLClassLoader.html#close())) won't that lead to a leak of any resources that might be involved ... especially any zip/jar files that might be opened?
> 
> Is it not worth trying to cache and reuse the loader?

I have updated the code to close the classloader. The jtreg doesn't have now any embedded implementations so path never could be null, I suppose.

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

PR: https://git.openjdk.org/jtreg/pull/136


More information about the jtreg-dev mailing list