On Thu, 17 Apr 2025 07:38:27 GMT, Timofei Pushkin <tpush...@openjdk.org> wrote:

>> test/hotspot/jtreg/runtime/cds/appcds/customLoader/RegUnregSuperTest.java 
>> line 77:
>> 
>>> 75:             out.shouldContain("CustomLoadee3Child (id 3) has super-type 
>>> CustomLoadee3 (id 1) overshadowed by another class with the same name");
>>> 76:         } else {
>>> 77:             out.shouldContain("unreg CustomLoadee3Child\n");
>> 
>> Could you remove the linefeed ('\n') chars?
>> I'm seeing test failure when running with the `-XX:+AOTClassLinking` option.
>> 
>> 
>> java.lang.RuntimeException: 'app   CustomLoadee3
>> ' missing from stdout/stderr
>>      at 
>> jdk.test.lib.process.OutputAnalyzer.shouldContain(OutputAnalyzer.java:253)
>>      at RegUnregSuperTest.main(RegUnregSuperTest.java:71)
>>      at 
>> java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
>>      at java.base/java.lang.reflect.Method.invoke(Method.java:565)
>>      at 
>> com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:335)
>>      at java.base/java.lang.Thread.run(Thread.java:1447)
>> 
>> The expected output is there:
>> `[1.686s][debug  ][cds,class] klasses[ 1548] = 0x00000008004c7518 app   
>> CustomLoadee3 aot-linked`
>
> Do I understand correctly that you modified the test's code to use 
> `-XX:+AOTClassLinking` to get this error? Do you think there should be 
> another test variant with `-XX:+AOTClassLinking` (it is easy to add)?
> 
> "\n" is used after "CustomLoadee3" because `shouldContain("unreg 
> CustomLoadee3")` will accept either "unreg CustomLoadee3" or "unreg 
> CustomLoadee3Child" and the second case is not what I want to detect.
> 
> Anyway, I've changed the test to pass when `-XX:+AOTClassLinking` is used.

No, I didn't modify the test code but ran your patch through our internal 
testing tiers. One of the tier specifies the `-XX:+AOTClassLinking` option. You 
can also run it via jtreg command line using the `-javaoptions`, e.g. 
`-javaoptions:"-XX:+AOTClassLinking"`

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24223#discussion_r2049215878

Reply via email to