Fix CoreclrTestWrapperLib to be robust against exited processes#113937
Conversation
There was a problem hiding this comment.
Pull Request Overview
This pull request improves the robustness of process handling in CoreclrTestWrapperLib by adding new extension methods for safely retrieving process IDs and names, and refactoring the child process search logic.
- Introduces TryGetProcessId and TryGetProcessName extension methods.
- Updates the FindChildProcessesByName method to use the new extension methods.
- Makes minor adjustments to exception handling in the symbolizer output code.
|
|
||
| } catch (Exception e) { | ||
| } | ||
| catch (Exception e) |
There was a problem hiding this comment.
The modified exception handling in the symbolizer output code introduces an additional catch block. Consider consolidating the error handling to streamline the code and ensure that no redundant catch blocks exist.
| Process child = childrenToCheck.Dequeue(); | ||
| if (seen.Contains(child.Id)) | ||
|
|
||
| if (!child.TryGetProcessId(out int processId)) |
There was a problem hiding this comment.
While using the new TryGetProcessId extension method enhances robustness, consider adding logging of the failure cases within the extension method to aid in debugging when a process has already exited.
|
/ba-g infrastructure timeout |
Fixes #112846