Summary
delete_resources.t and delete_only_create_resources.t both fail on cgroupv2-only systems due to hardcoded cgroupv1 paths and an explicit "cgroupv2 is not supported yet" stub in the library code.
Symptoms
delete_resources:
not ok 1 - find pids cgroup
# cgroupv2 is not supported yet
delete_only_create_resources:
open /sys/fs/cgroup/pids/cgrouptest/tasks: no such file or directory
Root cause
1. cgroups/cgroups.go — explicit cgroupv2 stub
FindCgroup() returns an error when only a cgroupv2 mount is found:
} else if postSeparatorFields[0] == "cgroup2" {
cgroupv2 = true
continue
// TODO cgroupv2 unimplemented
}
// ...
if cgroupv2 {
return nil, fmt.Errorf("cgroupv2 is not supported yet")
}
cgroups/cgroups_v2.go exists but all methods return fmt.Errorf("unimplemented yet").
2. validation/delete/delete.go — hardcoded cgroupv1 path
delete_only_create_resources.t writes directly to /sys/fs/cgroup/pids/cgrouptest/tasks — a cgroupv1 path that does not exist on cgroupv2 systems. The cgroupv2 equivalent is /sys/fs/cgroup/<path>/cgroup.procs.
Impact
All modern Linux distributions (Fedora 31+, Ubuntu 21.10+, Arch, RHEL 9+) have migrated to cgroupv2 by default. This makes both tests permanently failing on the majority of current Linux installs. Downstream runtimes (runc, youki, remora, etc.) cannot pass the conformance suite on cgroupv2 systems.
This // TODO has been present since at least 2018.
Fix
Implementing cgroups/cgroups_v2.go fully is significant work, but the minimum viable fix for the tests is:
- Detect cgroupv2 in
FindCgroup() and return a v2 implementation instead of erroring.
- Implement
CgroupV2.FindCgroup() using /proc/self/cgroup (unified hierarchy has a single entry: 0::<path>) and the cgroupv2 root at /sys/fs/cgroup.
- Update
delete_only_create_resources.t to write to cgroup.procs instead of tasks.
Alternatively, skip these tests with a clear message when running on a cgroupv2 host (similar to how the linux_cgroups_* tests emit # cgroupv2 is not supported yet and the test runner can mark them as SKIP).
Summary
delete_resources.tanddelete_only_create_resources.tboth fail on cgroupv2-only systems due to hardcoded cgroupv1 paths and an explicit"cgroupv2 is not supported yet"stub in the library code.Symptoms
delete_resources:delete_only_create_resources:Root cause
1.
cgroups/cgroups.go— explicit cgroupv2 stubFindCgroup()returns an error when only a cgroupv2 mount is found:cgroups/cgroups_v2.goexists but all methods returnfmt.Errorf("unimplemented yet").2.
validation/delete/delete.go— hardcoded cgroupv1 pathdelete_only_create_resources.twrites directly to/sys/fs/cgroup/pids/cgrouptest/tasks— a cgroupv1 path that does not exist on cgroupv2 systems. The cgroupv2 equivalent is/sys/fs/cgroup/<path>/cgroup.procs.Impact
All modern Linux distributions (Fedora 31+, Ubuntu 21.10+, Arch, RHEL 9+) have migrated to cgroupv2 by default. This makes both tests permanently failing on the majority of current Linux installs. Downstream runtimes (runc, youki, remora, etc.) cannot pass the conformance suite on cgroupv2 systems.
This
// TODOhas been present since at least 2018.Fix
Implementing
cgroups/cgroups_v2.gofully is significant work, but the minimum viable fix for the tests is:FindCgroup()and return a v2 implementation instead of erroring.CgroupV2.FindCgroup()using/proc/self/cgroup(unified hierarchy has a single entry:0::<path>) and the cgroupv2 root at/sys/fs/cgroup.delete_only_create_resources.tto write tocgroup.procsinstead oftasks.Alternatively, skip these tests with a clear message when running on a cgroupv2 host (similar to how the
linux_cgroups_*tests emit# cgroupv2 is not supported yetand the test runner can mark them as SKIP).