RFR: 8374200: jdk/internal/platform/cgroup/TestCgroupMetrics.java fails with common prefix metrics [v2]

David Holmes dholmes at openjdk.org
Tue Dec 23 02:09:05 UTC 2025


On Tue, 23 Dec 2025 01:47:30 GMT, Jie Fu <jiefu at openjdk.org> wrote:

>> Hi all,
>> 
>> `jdk/internal/platform/cgroup/TestCgroupMetrics.java` fails on machines with common prefix metrics.
>> 
>> For example, the cpu.stat may be
>> 
>> usage_usec 5111148455
>> user_usec 4457755664
>> system_usec 653392790
>> core_sched.force_idle_usec 0
>> nr_periods 0
>> nr_throttled 0
>> throttled_usec 0
>> nr_burst 0
>> burst_usec 0
>> nr_throttled_bt 0
>> throttled_usec_bt 0
>> 
>> 
>> `nr_throttled` and `nr_throttled_bt` are metrics with common prefix.
>> In this case, the test fails since it only matches the starting metric string.
>> 
>> The fix just adds one more filter `.filter(l -> l.split("\\s+")[0].equals(metric))`, which would match the metric exactly.
>
> Jie Fu has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Add a new regex to filter

That looks good to me. Thanks

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

Marked as reviewed by dholmes (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/28956#pullrequestreview-3606284595


More information about the hotspot-runtime-dev mailing list