JDK-8191375 : Add high-level jtreg VMProps to filter out CDS tests
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2017-11-16
  • Updated: 2019-06-20
  • Resolved: 2018-02-16
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11
11 b03Fixed
Related Reports
Relates :  
Relates :  
Sub Tasks
JDK-8193672 :  
Description
Currently the CDS tests are filtered out in an ad-hoc fashion. E.g., in test/hotspot/jtreg/runtime/appcds/HelloTest.java

 * @summary Hello World test for AppCDS
 * AppCDS does not support uncompressed oops
 * @requires (vm.opt.UseCompressedOops == null) | (vm.opt.UseCompressedOops == true)

The tests related to archived heap objects are more confusing:

 * Feature support: G1GC only, compressed oops/kptrs, 64-bit os, not on windows
 * @requires (sun.arch.data.model != "32") & (os.family != "windows")
 * @requires (vm.opt.UseCompressedOops == null) | (vm.opt.UseCompressedOops == true)
 * @requires vm.gc.G1

This should be changed to high-level properties to something like:

@require vm.cds
@require vm.cds.appcds
@require vm.cds.archived.objects

(names are TBD)

Comments
Another useful feature to consider in JDK 11 is TEST.properties, which we can use to compile common classes used by all the CDS tests. Here are example use by other parts of the OpenJDK repo: test/jdk/java/time/tck/TEST.properties:lib.build = jdk.testlibrary.RandomFactory test/jdk/java/time/test/TEST.properties:lib.build = jdk.testlibrary.RandomFactory -> Probably needs to be a different RFE for JDK 11.
11-12-2017

I agree with Ioi. This way we can reduce lengthy at-requires statements in the test, and have one place for adding rules.
22-11-2017

The current implementation of vm.cds checks only if the jvm DLL is built with INCLUDE_CDS WB_ENTRY(jboolean, WB_IsCDSIncludedInVmBuild(JNIEnv* env)) #if INCLUDE_CDS return true; #else return false; #endif WB_END We need to enhance it to cover cases like '@requires (vm.opt.UseCompressedOops == null) | (vm.opt.UseCompressedOops == true) '.
20-11-2017

Volker's proposal makes sense to me.
20-11-2017

I'd propose to tag all the new AppCDS test with "@requires vm.cds" because it is currently used to exclude the CDS tests from execution on platforms which don't support CDS. Once AppCDS will be checked in, we'll also need to exclude the AppCSD regression tests on those platforms.
20-11-2017

We already have vm.cds defined. So far its scope is: "CDS is supported by the VM", since some JVM variants choose to exclude CDS functionality. See: http://hg.openjdk.java.net/jdk/jdk/file/a2008587c13f/test/jtreg-ext/requires/VMProps.java protected String vmCDS() { if (WB.isCDSIncludedInVmBuild()) { return "true"; ... This was implemented by Goetz L. with my assistance in JDK-8186719 "[testbug] add @requires vm.cds to CDS tests in jdk test suite". So at least part of this functionality is covered. Note however, that the meaning of this requires flag is currently "JVM under test supports CDS".
16-11-2017