mirror of
https://github.com/openjdk/jdk.git
synced 2026-01-28 12:09:14 +00:00
8374200: jdk/internal/platform/cgroup/TestCgroupMetrics.java fails with common prefix metrics
Reviewed-by: dholmes
This commit is contained in:
parent
40755afdf9
commit
f1c50412f0
@ -121,7 +121,8 @@ public class MetricsTesterCgroupV2 implements CgroupMetricsTester {
|
||||
private long getLongValueEntryFromFile(String file, String metric) {
|
||||
Path filePath = Paths.get(UNIFIED.getPath(), file);
|
||||
try {
|
||||
String strVal = Files.lines(filePath).filter(l -> l.startsWith(metric)).collect(Collectors.joining());
|
||||
String strVal = Files.lines(filePath)
|
||||
.filter(l -> l.matches("^" + metric + "\\s+.*")).collect(Collectors.joining());
|
||||
if (strVal.isEmpty()) {
|
||||
// sometimes the match for the metric does not exist, e.g. cpu.stat's nr_periods iff the controller
|
||||
// is not enabled
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user