RFR: 7903044: Report `os.*` system properties in .jtr file [v2]

Jonathan Gibbons jjg at openjdk.java.net
Mon Dec 6 23:20:22 UTC 2021


On Tue, 9 Nov 2021 07:21:49 GMT, Christian Stein <cstein at openjdk.org> wrote:

>> src/share/classes/com/sun/javatest/regtest/exec/RegressionScript.java line 141:
>> 
>>> 139:         for (String p: props) {
>>> 140:             testResult.putProperty(p, System.getProperty(p));
>>> 141:         }
>> 
>> Nice and simple ... but probably too simple.
>> 
>> This will report the properties for the JVM running `jtreg`, which is OK for `user.name`, but for the `os.*` properties we probably want the values for the test JVM.  You can get the properties from `params.getTestJDK().getProperties()` ... or better still, use/report the values cached in `params.getTestOS()`.
>>  And, if we're going as far as using `params.getTestOS()` it might be worth printing out the full `OS.toString()`.
>>  
>>  So, suggest either
>>  
>>  *  `testResult.putProperty(` _name_ `, os.` _field_ `)` for the three values, or else just
>>  * `testProperty.putProperty("testJDK_OS", os.toString())`
>>  
>>  (or both?)
>
> Understood.
> 
> Does it make sense to also keep the additional information report for the JVM running `jtreg`? In summary, this would introduce 8 new lines, like:
> 
> 
> (JVM running jtreg) JDK_OS = ...
> (JVM running jtreg) os.arch = ...
> (JVM running jtreg) os.name = ...
> (JVM running jtreg) os.version = ...
> (Test JVM) JDK_OS = ...
> (Test JVM) os.arch = ...
> (Test JVM) os.name = ...
> (Test JVM) os.version = ...
> 
> Or are only the latter 4 interesting?

It's less important/interesting to give details about the VM running jtreg itself.

The primary interest is the VM running the test, because these `os.*` properties can be used to filter test execution.

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

PR: https://git.openjdk.java.net/jtreg/pull/35


More information about the jtreg-dev mailing list