-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TestProcesses failing on CI for darwin #148
Comments
This test looks non-deterministic in that it lists all processes and assumes the first one has an executable associated to it. If macos is like Linux and Windows, then this is not always true for special kernel processes. go-sysinfo/providers/darwin/process_darwin_test.go Lines 98 to 108 in 53d6396
|
I think we should update the test's error message to include the full process details so we can see what process is causing this. |
kern_procargs was not returning an error when kern.procargs2 failed. Then meant that you didn't get an error when the process no longer exists or when you didn't have permissions to access the process. For process.Info(), this especially affected builds running without CGO enabled. When running with CGO there are other calls that will fail with "no such process" or "operation not permitted" before we get to calling kern.procargs2, but without CGO it goes directly to calling kern.procargs2. This resulted in Info() returning a zero value types.ProcessInfo and no error. Fixes elastic#148
I opened a PR to address this at #150. |
* providers/darwin/process: fix error handling kern_procargs was not returning an error when kern.procargs2 failed. Then meant that you didn't get an error when the process no longer exists or when you didn't have permissions to access the process. For process.Info(), this especially affected builds running without CGO enabled. When running with CGO there are other calls that will fail with "no such process" or "operation not permitted" before we get to calling kern.procargs2, but without CGO it goes directly to calling kern.procargs2. This resulted in Info() returning a zero value types.ProcessInfo and no error. Fixes #148 * system_test.go: Ignore EINVAL for process.Info() Non-CGO build will return EINVAL when a process does not exist.
The
TestProcesses
is constantly failing on CI at least for #144, but it seems to be happening on other PRs as well, even though it passes locally.I don´t have a mac to investigate it further, I just got someone else to try it and as I said, itś working locally.
The text was updated successfully, but these errors were encountered: