RFR: 8338344: Test TestPrivilegedMode.java intermittent fails java.lang.NoClassDefFoundError: jdk/test/lib/Platform
SendaoYan
syan at openjdk.org
Wed Aug 14 11:55:48 UTC 2024
On Wed, 14 Aug 2024 10:48:44 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:
>> Hi,
>> Test `test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestPrivilegedMode.java` always fails by ours daily CI with fastdebug build, but I can't reproduce this fail standalone.
>> When the test fails `java.lang.NoClassDefFoundError: jdk/test/lib/Platform`, the `jdk/test/lib/Platform.class` locate in `/var/tmp/tone/run/jtreg/jt-work/jtreg/hotspot_jtreg/classes/5/test/lib`, but `bootClassPath` [set as](https://github.com/openjdk/jdk/blob/master/test/hotspot/jtreg/compiler/lib/ir_framework/driver/TestVMProcess.java#L103) `/var/tmp/tone/run/jtreg/jt-work/jtreg/hotspot_jtreg/classes/5/testlibrary_tests/ir_framework/tests/TestPrivilegedMode.d`
>>
>> bootClassPath += File.pathSeparator + Utils.TEST_CLASSES;
>>
>>
>> I think `bootClassPath` should set as `Utils.TEST_CLASS_PATH`.
>
> test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestPrivilegedMode.java line 38:
>
>> 36: * @modules java.base/jdk.internal.vm.annotation
>> 37: * @library /test/lib /
>> 38: * @build jdk.test.lib.Platform
>
> Is that really required or is it enough to set `TEST_CLASS_PATH`?
Yes, it's enough to set `TEST_CLASS_PATH`. But the jtreg [doc](https://openjdk.org/jtreg/tag-spec.html) suggest that `appropriate @build directives to ensure that the classes will be compiled`.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20576#discussion_r1716792631
More information about the hotspot-compiler-dev
mailing list