RFR: 8367302: New test jdk/jfr/event/profiling/TestCPUTimeSampleQueueAutoSizes.java from JDK-8366082 is failing

Johannes Bechberger jbechberger at openjdk.org
Thu Sep 18 13:00:01 UTC 2025


On Thu, 18 Sep 2025 01:16:44 GMT, Andrei Pangin <apangin at openjdk.org> wrote:

>> This change hopefully fixes the test failures by making the test cases more resilient.
>
> test/jdk/jdk/jfr/event/profiling/TestCPUTimeSampleQueueAutoSizes.java line 103:
> 
>> 101:             // setup recording
>> 102:             AtomicLong burstThreadId = new AtomicLong();
>> 103:             final long startTimeMillis = System.currentTimeMillis();
> 
> Do not use `System.currentTimeMillis()` for time intervals: 1) it suffers from rounding errors due to low resolution; 2) it is not guaranteed to be monotonic. Use `System.nanoTime()` or `Instant.now()` instead.

Thanks

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27293#discussion_r2359140696


More information about the hotspot-jfr-dev mailing list