func InCgroupV2(t *testing.T, fn func(*CgroupV2))
InCgroupV2 creates a new v2 cgroup, migrates the current process into it, and then calls fn. When fn returns, the current process is migrated back to the original cgroup and the new cgroup is destroyed.
If a new cgroup cannot be created, the test is skipped.
This must not be used in parallel tests, as it affects the entire process.
type CgroupV2 struct {
// contains filtered or unexported fields
}
func (c *CgroupV2) CPUMaxPath() string
Path to cpu.max.
func (c *CgroupV2) Path() string
func (c *CgroupV2) SetCPUMax(quota, period int64) error
Set cpu.max. Pass -1 for quota to disable the limit.