8313770: jdk/internal/platform/docker/TestSystemMetrics.java fails on Ubuntu

Reviewed-by: sgehwolf, mbaesken, syan
This commit is contained in:
Casper Norrbin 2025-10-23 09:06:00 +00:00
parent dcf46a0a19
commit aec138886e

View File

@ -1,5 +1,6 @@
/*
* Copyright (c) 2020, Red Hat Inc.
* Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -447,13 +448,13 @@ public class MetricsTesterCgroupV2 implements CgroupMetricsTester {
Metrics metrics = Metrics.systemMetrics();
long oldVal = metrics.getBlkIOServiceCount();
long newVal = getIoStatAccumulate(new String[] { "rios", "wios" });
if (!CgroupMetricsTester.compareWithErrorMargin(oldVal, newVal)) {
if (newVal < oldVal) {
fail("io.stat->rios/wios: ", oldVal, newVal);
}
oldVal = metrics.getBlkIOServiced();
newVal = getIoStatAccumulate(new String[] { "rbytes", "wbytes" });
if (!CgroupMetricsTester.compareWithErrorMargin(oldVal, newVal)) {
if (newVal < oldVal) {
fail("io.stat->rbytes/wbytes: ", oldVal, newVal);
}
}