We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9715e6d commit cbe82caCopy full SHA for cbe82ca
test/lib/jdk/test/lib/containers/cgroup/MetricsTesterCgroupV2.java
@@ -121,7 +121,10 @@ private long getLongValueFromFile(String file) {
121
private long getLongValueEntryFromFile(String file, String metric) {
122
Path filePath = Paths.get(UNIFIED.getPath(), file);
123
try {
124
- String strVal = Files.lines(filePath).filter(l -> l.startsWith(metric)).collect(Collectors.joining());
+ String strVal = Files.lines(filePath)
125
+ .filter(l -> l.startsWith(metric))
126
+ .filter(l -> l.split("\\s+")[0].equals(metric))
127
+ .collect(Collectors.joining());
128
if (strVal.isEmpty()) {
129
// sometimes the match for the metric does not exist, e.g. cpu.stat's nr_periods iff the controller
130
// is not enabled
0 commit comments