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:20:57 UTC 2025
On Thu, 18 Sep 2025 01:58:18 GMT, Andrei Pangin <apangin at openjdk.org> wrote:
>> test/jdk/jdk/jfr/event/profiling/TestCPUTimeSampleQueueAutoSizes.java line 154:
>>
>>> 152: ThreadMXBean bean = ManagementFactory.getThreadMXBean();
>>> 153: long start = bean.getCurrentThreadCpuTime();
>>> 154: while (bean.getCurrentThreadCpuTime() - start < millis * 1_000_000) {
>>
>> Isn't this method supposed to check CPU time of the passed `thread` rather than current thread?
>
> BTW, is there a specific reason to burn cpu in a separate thread? It can be done in the same `main` thread, isn't it?
> Isn't this method supposed to check CPU time of the passed thread rather than current thread?
You're correct.
> It can be done in the same main thread, isn't it?
You're correct and it makes the code so much easier.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27293#discussion_r2359252129
More information about the hotspot-jfr-dev
mailing list