procEnv returns the environment variables for a given process.
(t *testing.T, pid int)
| 206 | |
| 207 | // procEnv returns the environment variables for a given process. |
| 208 | func procEnv(t *testing.T, pid int) []string { |
| 209 | t.Helper() |
| 210 | |
| 211 | env, err := os.ReadFile(fmt.Sprintf("/proc/%d/environ", pid)) |
| 212 | require.NoError(t, err) |
| 213 | return strings.Split(string(env), "\x00") |
| 214 | } |
| 215 | |
| 216 | func expectedNiceScore(t *testing.T) int { |
| 217 | t.Helper() |