openj9 icon indicating copy to clipboard operation
openj9 copied to clipboard

Move SharedClassAPI test native code into openj9

Open annaibm opened this issue 7 months ago • 12 comments

  • Move the sharedClasses native code from openj9_systemtest into OpenJ9, as part of removing the native compiler dependency in system tests.

related:https://github.com/adoptium/aqa-tests/issues/5965

annaibm avatar Apr 14 '25 19:04 annaibm

Grinder link: https://hyc-runtimes-jenkins.swg-devops.com/job/Build_JDK21_x86-64_linux_Personal/1728/

14:37:35  [ 22%] Linking C shared library ../../libsharedClasses.so
14:37:35  [ 22%] Built target run_constgen
14:37:35  [ 22%] Building C object runtime/tests/shared/CMakeFiles/SharedClassesNativeAgent.dir/__/__/copyright.c.o
14:37:35  [ 22%] Building C object runtime/tests/port/CMakeFiles/pltest.dir/j9dumpTest.c.o
14:37:35  Scanning dependencies of target j9zip
14:37:35  [ 22%] Linking C shared library ../../libSharedClassesNativeAgent.so
14:37:35  [ 22%] Building C object runtime/zip/CMakeFiles/j9zip.dir/zcpool.c.o
14:37:35  [ 22%] Built target sharedClasses

Once this change is merged, will make changes in below JDK versions to include the shared classes in test-images. https://github.com/ibmruntimes/openj9-openjdk-jdk https://github.com/ibmruntimes/openj9-openjdk-jdk24 https://github.com/ibmruntimes/openj9-openjdk-jdk21 https://github.com/ibmruntimes/openj9-openjdk-jdk17 https://github.com/ibmruntimes/openj9-openjdk-jdk11 https://github.com/ibmruntimes/openj9-openjdk-jdk8

annaibm avatar Apr 14 '25 19:04 annaibm

Just for the record, sharedClasses.c is moved from https://github.com/adoptium/openj9-systemtest/blob/master/openj9.test.sharedClasses.jvmti/src/native/sharedClasses.c

llxia avatar May 13 '25 14:05 llxia

The above job link has expired. Could you run it again? We also need to test on other platforms.

llxia avatar May 13 '25 14:05 llxia

@pshipton could you also review the change? Thanks

llxia avatar May 13 '25 14:05 llxia

Grinder link: JDK21 https://hyc-runtimes-jenkins.swg-devops.com/job/Build_JDK21_x86-64_linux_Personal/1855/

15:54:04  Scanning dependencies of target sharedClasses
15:54:04  [ 23%] Building C object runtime/tests/sharedclassapi/CMakeFiles/sharedClasses.dir/sharedClasses.c.o
15:54:04  [ 23%] Building C object runtime/util/CMakeFiles/j9util.dir/fltdmath.c.o
15:54:04  [ 23%] Building C object runtime/util/CMakeFiles/j9util.dir/fltmath.c.o
15:54:04  [ 23%] Building C object runtime/util/CMakeFiles/j9util.dir/fltodd.c.o
15:54:04  [ 23%] Building C object runtime/tests/sharedclassapi/CMakeFiles/sharedClasses.dir/__/__/copyright.c.o
15:54:04  [ 23%] Building C object runtime/util/CMakeFiles/j9util.dir/fltrem.c.o
15:54:04  [ 23%] Linking C shared library ../../libsharedClasses.so
15:54:04  [ 23%] Building C object runtime/util/CMakeFiles/j9util.dir/genericSignalHandler.c.o
15:54:04  [ 23%] Built target sharedClasses
15:54:04  [ 23%] Building C object runtime/util/CMakeFiles/j9util.dir/hshelp.c.o

JDK11 https://hyc-runtimes-jenkins.swg-devops.com/job/Build_JDK11_x86-64_linux_Personal/7697/

annaibm avatar May 13 '25 15:05 annaibm

I don't see this test included in any playlist (in OpenJ9). Shouldn't this change add that?

keithc-ca avatar May 29 '25 20:05 keithc-ca

I don't see this test included in any playlist (in OpenJ9). Shouldn't this change add that?

yes, you are right that this test isn't added to an OpenJ9 playlist because it's already included in the existing aqa-tests playlist under: 🔗 sharedClasses/playlist.xml#L26

As part of the task: "Move SharedClassAPI test native code into OpenJ9", we migrated the native code (sharedClasses.c) from the original location in openj9-systemtest into OpenJ9 to eliminate native compilation within the test and stop building it in the tests.

The test itself is already active and run via that playlist, so no additional playlist changes in OpenJ9 are needed. sharedClasses/playlist.xml#L26

annaibm avatar May 29 '25 21:05 annaibm

Jenkins test system.extended zlinux jdk21

keithc-ca avatar May 30 '25 20:05 keithc-ca

I botched the test command. Rather than start over and run more testing than necessary, please run (or explain how I could run) a grinder to test this. I couldn't find a playlist.xml that refers to the new library.

keithc-ca avatar Jun 02 '25 13:06 keithc-ca

Right now, we are only moving the native code (sharedClasses.c) into OpenJ9 and building the libsharedClasses.so library as part of the OpenJ9 build process. We haven’t yet updated the SharedClassesAPI test to point to or load this new library path. (test: sharedClasses/playlist.xml#L26)

The Grinder run is still using the old path from openj9-systemtest for libsharedClasses.so. Original run: https://hyc-runtimes-jenkins.swg-devops.com/job/Grinder/51106/

  • The next step will be to change the test paths within SharedClassesAPI to use this newly built library, but that hasn’t been done yet.

So at this stage, you won’t find any references to the new library in the existing playlist.xml or test lists, since the test itself still uses the old library path.

Currently, the following personal build test images contain the libsharedClasses.so library, as demonstrated by the Grinder builds below:

linux: https://hyc-runtimes-jenkins.swg-devops.com/job/Build_JDK8_x86-64_linux_Personal/3592/ Screenshot 2025-06-03 at 2 27 41 PM

win: https://hyc-runtimes-jenkins.swg-devops.com/job/Build_JDK21_x86-64_windows_Personal/532/ mac https://hyc-runtimes-jenkins.swg-devops.com/job/Build_JDK17_aarch64_mac_Personal/504/ aix: https://hyc-runtimes-jenkins.swg-devops.com/job/Build_JDK11_ppc64_aix_Personal/1523/ zos : (zos repos yet to be updated with the library) https://hyc-runtimes-jenkins.swg-devops.com/job/Build_JDK11_s390x_zos_Personal/4469/

annaibm avatar Jun 03 '25 18:06 annaibm

haven’t yet updated the SharedClassesAPI test to point to or load this new library path

The library should be in the test-image, so I would not expect any path to need to be updated.

keithc-ca avatar Jun 05 '25 14:06 keithc-ca

I've opened a draft PR to update the SharedClassesAPI test in the openj9-systemtest repo: 🔗 https://github.com/adoptium/openj9-systemtest/pull/163 to use this sharedClasses library from the test-images.

annaibm avatar Jun 09 '25 20:06 annaibm

Thank you @keithc-ca!

annaibm avatar Jun 17 '25 19:06 annaibm