In https://ci.chromium.org/p/chromeos/builders/luci.chromeos.general/CQ/b8925459339075851920, security.SELinuxProcesses failed due to a process not being found:
2019/01/02 01:04:35 Started test security.SELinuxProcesses
2019/01/02 01:04:35 [01:04:35.319] Error at selinux_processes.go:35: Failed to get processes: read /proc/4936/cmdline: no such process
2019/01/02 01:04:35 [01:04:35.319] Stack trace:
Failed to get processes
at chromiumos/tast/local/bundles/cros/security.SELinuxProcesses (selinux_processes.go:35)
at chromiumos/tast/testing.(*Test).Run.func4 (test.go:228)
at chromiumos/tast/testing.runStages.func1.1 (stage.go:39)
at chromiumos/tast/testing.runAndRecover.func1 (stage.go:69)
at runtime.goexit (asm_arm.s:1015)
read /proc/4936/cmdline: no such process
2019/01/02 01:04:35 Completed test security.SELinuxProcesses in 396ms with 1 error(s)
selinux.GetProcesses currently calls os.IsNotExist on errors that gopsutil returns while reading data from /proc and skips only os.ErrNotExist. It looks from the above message like gopsutil can also return "no such process" errors (I think that this is ESRCH).
This code should probably skip all errors instead. I don't see any promises from gopsutil about what errors it will return, so it's unsafe to depend on specific behavior.
Comment 1 by bugdroid1@chromium.org
, Jan 3