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

Function TestParseMemoryOomControl

cgroup1/memory_test.go:119–138  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

117}
118
119func TestParseMemoryOomControl(t *testing.T) {
120 var (
121 c = &memoryController{}
122 m = &v1.MemoryOomControl{}
123 r = strings.NewReader(memoryOomControlData)
124 )
125 if err := c.parseOomControlStats(r, m); err != nil {
126 t.Fatal(err)
127 }
128 index := []uint64{
129 m.OomKillDisable,
130 m.UnderOom,
131 m.OomKill,
132 }
133 for i, v := range index {
134 if v != uint64(i)+1 {
135 t.Errorf("expected value at index %d to be %d but received %d", i, i+1, v)
136 }
137 }
138}
139
140func TestMemoryController_Stat(t *testing.T) {
141 // GIVEN a cgroups folder with all the memory metrics

Callers

nothing calls this directly

Calls 1

parseOomControlStatsMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…