On Tue, 22 Sep 2026 13:19:03 GMT, Manuel Hässig <[email protected]> wrote:

>> Vladimir Kozlov has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   Add guarantee to initialize_runtime_shared_and_meta_spaces
>
> test/hotspot/jtreg/runtime/cds/appcds/aotCode/TestAOTCodeCounters.java line 
> 58:
> 
>> 56:         {"-XX:AOTCodeInvokeBase=10000.0", 
>> "-XX:AOTCodeInvokeScale=0.001"},
>> 57:         {"-XX:AOTCodeInvokeBase=10000.0", 
>> "-XX:AOTCodeInvokeScale=1000.0"}
>> 58:     };
> 
> A run with random values would be nice. Something like
> 
> Suggestion:
> 
> import java.util.Random;
> 
> import jdk.test.lib.cds.CDSAppTester;
> import jdk.test.lib.process.OutputAnalyzer;
> import jdk.test.lib.Utils;
> 
> public class TestAOTCodeCounters {
>     private static final Random RANDOM = Utils.getRandomInstance();
>     
>     // Too long to test both, default and opposite, values.
>     // Only test opposite.
>     static double randomBase = RANDOM.nextDouble(1.0, 10000.0);
>     static double randomScale = RANDOM.nextDouble(0.001, 1000.0);
>     static String[][] flags = {
>         {"-XX:AOTCodeInvokeBase=1.0",     "-XX:AOTCodeInvokeScale=0.001"},
>         {"-XX:AOTCodeInvokeBase=1.0",     "-XX:AOTCodeInvokeScale=1000.0"},
>         {"-XX:AOTCodeInvokeBase=10000.0", "-XX:AOTCodeInvokeScale=0.001"},
>         {"-XX:AOTCodeInvokeBase=10000.0", "-XX:AOTCodeInvokeScale=1000.0"},
>         {"-XX:AOTCodeInvokeBase=" + randomBase.toString(), 
> "-XX:AOTCodeInvokeScale=" + randomScale.toString()}
>     };
> 
> Also, isn't this already testing default and opposite values?

@mhaessig, no, it is not tested with default value and opposite limits.
I would also need to print random values to reproduce an issue if needed.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/30778#discussion_r4073807991

Reply via email to