On Mon, 1 Dec 2025 12:45:06 GMT, Casper Norrbin <[email protected]> wrote:
>> Hi everyone, >> >> Many container tests verify that various resource limits work as expected. >> However, when running containers in rootless mode on both Docker and Podman >> with cgroup v1, resource limits are not supported. This causes tests to fail >> with error messages like: `Resource limits are not supported and ignored on >> cgroups V1 rootless systems`. >> >> To address this, we should skip these tests when running on configurations >> that don't support resource limits, similar to how we already handle other >> unsupported configurations (e.g., missing container engine or >> incompatibility with a specific cgroup version or container runtime). >> >> To check for this, we now need to use >> `Metrics.systemMetrics().getProvider()` from `jdk.internal.platform.Metrics` >> to detect cgroup v1. I've added this functionality to `DockerTestUtils`, >> which is already used by all container tests. As a result, all container >> tests now need to include the `java.base/jdk.internal.platform` module, even >> if they don't directly test resource limits. >> >> Testing: >> * Oracle tiers 1-5 >> * Local testing: >> - `hotspot/jtreg/containers/` >> - `jdk/jdk/internal/platform/docker/` >> on cgroup v1/v2 with Podman and Docker in both rootful and rootless >> configurations > > Casper Norrbin has updated the pull request incrementally with one additional > commit since the last revision: > > reworked check docker/resourcelimit functions OK ------------- Marked as reviewed by sgehwolf (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/28557#pullrequestreview-3525791884
