Skip to content

Skip unit tests that assume the system does not use cgroup v2. #119329

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions pkg/kubelet/kuberuntime/kuberuntime_container_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,10 @@ func TestGenerateLinuxContainerConfigResources(t *testing.T) {
}

func TestCalculateLinuxResources(t *testing.T) {
if libcontainercgroups.IsCgroup2UnifiedMode() {
t.Skip("This test is skipped when running on systems using cgroup v2 unified mode")
}

_, _, m, err := createTestRuntimeManager()
m.cpuCFSQuota = true

Expand Down Expand Up @@ -725,6 +729,10 @@ func TestGenerateLinuxContainerConfigSwap(t *testing.T) {
}

func TestGenerateLinuxContainerResources(t *testing.T) {
if libcontainercgroups.IsCgroup2UnifiedMode() {
t.Skip("This test is skipped when running on systems using cgroup v2 unified mode")
}

_, _, m, err := createTestRuntimeManager()
assert.NoError(t, err)
m.machineInfo.MemoryCapacity = 17179860387 // 16GB
Expand Down
5 changes: 5 additions & 0 deletions pkg/kubelet/kuberuntime/kuberuntime_sandbox_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ package kuberuntime
import (
"testing"

libcontainercgroups "github.com/opencontainers/runc/libcontainer/cgroups"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
v1 "k8s.io/api/core/v1"
Expand All @@ -31,6 +32,10 @@ import (
)

func TestApplySandboxResources(t *testing.T) {
if libcontainercgroups.IsCgroup2UnifiedMode() {
t.Skip("This test is skipped when running on systems using cgroup v2 unified mode")
}

_, _, m, err := createTestRuntimeManager()
m.cpuCFSQuota = true

Expand Down