(t *testing.T)
| 369 | } |
| 370 | |
| 371 | func TestCgroupv2PSIStats(t *testing.T) { |
| 372 | checkCgroupMode(t) |
| 373 | group := "/psi-test-cg" |
| 374 | groupPath := fmt.Sprintf("%s-%d", group, os.Getpid()) |
| 375 | res := Resources{} |
| 376 | c, err := NewManager(defaultCgroup2Path, groupPath, &res) |
| 377 | require.NoError(t, err, "failed to init new cgroup manager") |
| 378 | t.Cleanup(func() { |
| 379 | os.Remove(c.path) |
| 380 | }) |
| 381 | |
| 382 | stats, err := c.Stat() |
| 383 | require.NoError(t, err, "failed to get cgroup stats") |
| 384 | if stats.CPU.PSI == nil || stats.Memory.PSI == nil || stats.Io.PSI == nil { |
| 385 | t.Error("expected psi not nil but got nil") |
| 386 | } |
| 387 | } |
| 388 | |
| 389 | func TestSystemdCgroupPSIController(t *testing.T) { |
| 390 | checkCgroupMode(t) |
nothing calls this directly
no test coverage detected
searching dependent graphs…