RFR: 7903781: Report the process id of the agent or other VM that was used for a jtreg action [v2]

Christian Stein cstein at openjdk.org
Mon Aug 19 07:55:59 UTC 2024


On Mon, 19 Aug 2024 04:31:32 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:

>> src/share/classes/com/sun/javatest/regtest/util/ProcessUtils.java line 38:
>> 
>>> 36: 
>>> 37:     private static final Method destroyForciblyMethod;
>>> 38:     private static final Method PID_METHOD;
>> 
>> How much we we still need reflective access to these methods?  
>> If they are only invoked from the `jtreg` tool (and never from a test VM), then the minimum level of JDK required to run `jtreg` is currently 11, right? And, we no longer support running test-VM code on anything less than 8, right?
>> 
>> So, at some level, it seems we may not need `ProcessUtils` any more -- unless maybe as a convenience wrapper.
>
> Hello Jon,
> 
>> And, we no longer support running test-VM code on anything less than 8, right?
> 
> I think you are right. Although, the `Process.pid()` is only available in Java 9+, I think that call is only run on the `jtreg` tool's VM which as you note seems to require Java 11 (I will have to verify some JDK CI runs to be sure that's the case currently). 
> 
> If it's OK, then I'll take up the usage and possible remove of this reflection code as a separate issue and verify things work fine without it.

I created [CODETOOLS-7903789](https://bugs.openjdk.org/browse/CODETOOLS-7903789) as a follow-up issue to replace those reflection-based method invocations. Let's keep the scope of changes of the PR small(er), in order to release jtreg 7.5 soon(er).

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

PR Review Comment: https://git.openjdk.org/jtreg/pull/215#discussion_r1721354680


More information about the jtreg-dev mailing list