Integrated: 8374200: jdk/internal/platform/cgroup/TestCgroupMetrics.java fails with common prefix metrics

Jie Fu jiefu at openjdk.org
Tue Dec 23 14:36:17 UTC 2025


On Mon, 22 Dec 2025 15:31:37 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.

This pull request has now been integrated.

Changeset: f1c50412
Author:    Jie Fu <jiefu at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/f1c50412f0ded30f88720e9489e3ff4dd347ffa3
Stats:     2 lines in 1 file changed: 1 ins; 0 del; 1 mod

8374200: jdk/internal/platform/cgroup/TestCgroupMetrics.java fails with common prefix metrics

Reviewed-by: dholmes

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

PR: https://git.openjdk.org/jdk/pull/28956


More information about the hotspot-runtime-dev mailing list