MCPcopy Create free account
hub / github.com/containerd/cgroups / TestIgnoreUnitExistsWhenPidNegativeOne

Function TestIgnoreUnitExistsWhenPidNegativeOne

cgroup2/manager_test.go:65–76  ·  view source on GitHub ↗

kubelet relies on this behavior to make sure a slice exists

(t *testing.T)

Source from the content-addressed store, hash-verified

63
64// kubelet relies on this behavior to make sure a slice exists
65func TestIgnoreUnitExistsWhenPidNegativeOne(t *testing.T) {
66 checkCgroupMode(t)
67
68 cmd, group := setupForNewSystemd(t)
69 proc := cmd.Process
70
71 _, err := NewSystemd("", group, proc.Pid, &Resources{})
72 require.NoError(t, err, "Failed to init new cgroup manager")
73
74 _, err = NewSystemd("", group, -1, &Resources{})
75 require.NoError(t, err, "Expected to be able to recreate cgroup manager")
76}
77
78//nolint:staticcheck // Staticcheck false positives for nil pointer deference after t.Fatal
79func TestEventChanCleanupOnCgroupRemoval(t *testing.T) {

Callers

nothing calls this directly

Calls 3

checkCgroupModeFunction · 0.85
setupForNewSystemdFunction · 0.85
NewSystemdFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…