adoptium / aqa-tests

Home of test infrastructure for Adoptium builds
https://adoptium.net/aqavit
Apache License 2.0
125 stars 304 forks source link

Support openj9 to run openjdk hotspot_custom target for jvmti tests #5370

Closed LongyuZhang closed 3 weeks ago

LongyuZhang commented 4 weeks ago
LongyuZhang commented 4 weeks ago

Test Link: hyc_grinder 41198

pshipton commented 4 weeks ago

libJvmtiGetSystemPropertyTest.so should be part of the test image, but it's not on jdk17. I see it's there for jdk21. Seems we need to expand building the native code for jdk17 similarly to what has been done for jdk21.

fengxue-IS commented 4 weeks ago

serviceability test suite have only been enabled on OpenJ9 for JDK 19+ to support Project Loom, so I don't suppose this should be verified against JDK17

LongyuZhang commented 4 weeks ago

Tested with JDK21 (hyc_grinder 41212), still failed with the same output: TARGET: disabled.hotspot_custom, CUSTOM_TARGET: serviceability/jvmti/GetSystemProperty/JvmtiGetSystemPropertyTest.java

21:48:14  STDERR:
21:48:14  JVMJ9TI001E Agent library JvmtiGetSystemPropertyTest could not be opened (libJvmtiGetSystemPropertyTest.so: cannot open shared object file: No such file or directory)
21:48:14  JVMJ9VM015W Initialization error for library j9jvmti29(-3): JVMJ9VM009E J9VMDllMain failed
LongyuZhang commented 4 weeks ago

Test with sanity/BasicVMTest.java, passed successfully (hyc_grinder 41215/testReport)

fengxue-IS commented 4 weeks ago

Tested with JDK21 (hyc_grinder 41212), still failed with the same output: TARGET: disabled.hotspot_custom, CUSTOM_TARGET: serviceability/jvmti/GetSystemProperty/JvmtiGetSystemPropertyTest.java

21:48:14  STDERR:
21:48:14  JVMJ9TI001E Agent library JvmtiGetSystemPropertyTest could not be opened (libJvmtiGetSystemPropertyTest.so: cannot open shared object file: No such file or directory)
21:48:14  JVMJ9VM015W Initialization error for library j9jvmti29(-3): JVMJ9VM009E J9VMDllMain failed

I suspect the failure is due to use of JVM_NATIVE_OPTIONS in https://github.com/adoptium/aqa-tests/blob/0f1508971ddb416332fdf96de93fd9c1a9f4dfc3/openjdk/playlist.xml#L105

which is defined based on the JDK_IMPL test is running against: https://github.com/adoptium/aqa-tests/blob/0f1508971ddb416332fdf96de93fd9c1a9f4dfc3/openjdk/openjdk.mk#L184-L190

but for serviceability test suite, -nativepath:"$(TESTIMAGE_PATH)/hotspot/jtreg/native" is required for openj9 impl as well. see example in serviceability_jvmti_j9 suite https://github.com/adoptium/aqa-tests/blob/0f1508971ddb416332fdf96de93fd9c1a9f4dfc3/openjdk/playlist.xml#L401-L408

FYI @LongyuZhang

llxia commented 3 weeks ago

I thought I commented on it yesterday. Anyway, instead of using JVM_NATIVE_OPTIONS in the playlist for hotspot_custom, set -nativepath:"$(TESTIMAGE_PATH)/hotspot/jtreg/native"

Subtests of serviceability_jvmti_j9 (i.e., serviceability/jvmti/GetSystemProperty/JvmtiGetSystemPropertyTest.java) have to run to completion with hotspot_custom. It is the purpose of this PR.

LongyuZhang commented 3 weeks ago

Updated the PR based on @fengxue-IS and @llxia comments. New test links for serviceability/jvmti/GetSystemProperty/JvmtiGetSystemPropertyTest.java