Tibor17 commented on issue #3176:
URL:
https://github.com/apache/maven-surefire/issues/3176#issuecomment-3899723786
This is the test result on Ubuntu. The outcome is that the errorCode is
irelevant for us, and the command is crashed on unknown binary if started
command throws IOException and this is important in order to continue with PING
after the first crash.
1. This is the case when the PID exists but the command is not found on the
system:
Let's rename `ps` to `psx` which simulates that the `ps` does not exist.
`java.io.IOException: Cannot run program "psx": Exec failed, error: 2 (No
such file or directory)`
This behavior is the same in Windows.
2. This is case when PID does not exists but the command exists:
No values, no numbers because the process does not exist.
`$ ps -p 3026
PID TTY TIME CMD`
ProcessBuilder.waitFor() returns exit code 1. This behavior is
different from Windows which returns exit code 0. In both cases
the result values are missing.
3. Finally, the happy case:
Found a process by PID 3025:
`$ ps -p 3025`
PID TTY TIME CMD
3025 ? 00:03:18 idea`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]