On Fri, 28 Nov 2025 15:03:25 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

This pull request has now been integrated.

Changeset: f1a4d1bf
Author:    Casper Norrbin <[email protected]>
URL:       
https://git.openjdk.org/jdk/commit/f1a4d1bfde652cf758117b93bbd02ae8248e805e
Stats:     154 lines in 27 files changed: 29 ins; 71 del; 54 mod

8372615: Many container tests fail when running rootless on cgroup v1

Reviewed-by: sgehwolf, dholmes

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

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

Reply via email to