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

Jie Fu jiefu at openjdk.org
Tue Dec 23 01:47:30 UTC 2025


> 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

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/28956/files
  - new: https://git.openjdk.org/jdk/pull/28956/files/cbe82ca7..905dad8a

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=28956&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28956&range=00-01

  Stats: 3 lines in 1 file changed: 0 ins; 2 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/28956.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28956/head:pull/28956

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


More information about the hotspot-runtime-dev mailing list