RFR: 8338344: Test TestPrivilegedMode.java intermittent fails java.lang.NoClassDefFoundError: jdk/test/lib/Platform

SendaoYan syan at openjdk.org
Wed Aug 14 07:12:50 UTC 2024


On Wed, 14 Aug 2024 05:58:27 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:

> Why doesn't it fail locally/standalone? What is different in your CI?

When run this test locally, the `jdk/test/lib/Platform.class` locate in `JTwork/classes/0/testlibrary_tests/ir_framework/tests/TestPrivilegedMode.d`, and `bootClassPath` set the same path, so test run passed.
Locally run command:

rm -rf tmp/ ; time jtreg -va -nr -w tmp -conc:40 -jdk:build/linux-x86_64-server-fastdebug/images/jdk/ test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestPrivilegedMode.java


When run this by CI, the `jdk/test/lib/Platform.class` locate in `JTwork/hotspot_jtreg/classes/5/test/lib`, so bootclass loader can't find `jdk/test/lib/Platform.class`.
CI invoke jtreg command like:

timeout 860000 jtreg -nativepath:/var/tmp/tone/run/jtreg/test-images/hotspot/jtreg/native -e:TEST_IMAGE_DIR=/var/tmp/tone/run/jtreg/test-images -e:LD_LIBRARY_PATH=/var/tmp/tone/run/jtreg/jdk-repo/build/tools/lib -a -ea -esa -retain:fail,error,*.dmp,javacore.*,heapdump.*,*.trc -ignore:quiet -xml:verify -v:fail,error -timeoutFactor:10 -conc:16 -w jt-work/jtreg -r jt-report/jtreg jdk-repo/test/hotspot/jtreg jdk-repo/test/jdk jdk-repo/test/langtools jdk-repo/test/jaxp jdk-repo/test/lib-test


I think we can not expected that the `jdk/test/lib/Platform.class` always locate in `TEST_CLASSES`, we should set `bootClassPath` as `TEST_CLASS_PATH ` to make sure bootclass loader can find `jdk/test/lib/Platform.class`.

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

PR Comment: https://git.openjdk.org/jdk/pull/20576#issuecomment-2288012486


More information about the hotspot-compiler-dev mailing list