RFR JDK-8251213 [TESTBUG] CDS tests shouldn't write output files into test.classes directory

Ioi Lam ioi.lam at oracle.com
Thu Aug 6 20:39:06 UTC 2020



On 8/6/20 11:38 AM, calvin.cheung at oracle.com wrote:
> Hi Ioi,
>
> Thanks for fixing this.
>
> Couple of minor comments:
>
> 1) MultiReleaseJars.java
>
>   37 import jdk.test.lib.process.OutputAnalyzer;
>   38 import jdk.test.lib.cds.CDSTestUtils;
>
> Please swap the order of the above.
>

Fixed

> 2) You've made changes to the tests under 
> dynamicArchive/methodHandles. Can you apply the same change to the 
> CDSMHTest_generate.sh since those tests are being generated by the 
> script?
>

Fixed. I re-ran the script and it generated the exact same contents as 
my manually edited version.

> No need for another webrev for the above changes.
>
> One suggestion (I think it should be done in another RFE):
>
> Several tests are doing the following:
>
>     File dir = new File(System.getProperty("user.dir"));
>
> I'm thinking add another method in CDSTestUtils to return the 
> outputDirAsFile so that the above could be:
>
>     File dir = CDSTestUtils.getOutputDirAsFile();
>

I filed https://bugs.openjdk.java.net/browse/JDK-8251267 --
CDS tests should use CDSTestUtils.getOutputDir instead of 
System.getProperty("user.dir")

Thanks
- Ioi

> thanks,
>
> Calvin
>
> On 8/5/20 11:21 PM, Ioi Lam wrote:
>> https://bugs.openjdk.java.net/browse/JDK-8251213
>> http://cr.openjdk.java.net/~iklam/jdk16/8251213-cds-shouldnt-write-test-classes-dir.v01/ 
>>
>>
>> Many of the CDS tests would write output files to the directory
>> given by System.getProperty("test.classes").
>>
>> I changed them to write to the scratch directory, i.e.,
>> System.getProperty("user.dir", "."). This way, it's easier to examine 
>> the
>> output of the tests.
>>
>> Please start the review with CDSTestUtils.java.
>>
>> I validated the change by going to the jtreg work directory and:
>>
>>     $ find $(find . -name classes) -type f | grep -v '[.]class$' | wc -l
>>     0
>>
>> (There used to be a lot of .jsa, .classlist, .stdout, etc).
>>
>> Executed all the tests locally on Linux. Running mach5 tiers1-4.
>>
>> Thanks
>> - Ioi



More information about the hotspot-runtime-dev mailing list