Add more protection against exited processed in CoreclrTestLib#115642
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR enhances the robustness of process retrieval in CoreclrTestLib by adding protection against exceptions when processes exit unexpectedly and updating the logging mechanism.
- Use TryGetProcessName and TryGetProcessId for logging process details
- Wrap GetChildren() calls in try-catch blocks to handle process exit exceptions
- Update logging output for active processes
Comments suppressed due to low confidence (2)
src/tests/Common/Coreclr.TestWrapper/CoreclrTestWrapperLib.cs:684
- TryGetProcessName is used with an output type of int for parentProcessName, which is inconsistent with typical process name types that are strings. Please verify if this is intended or update the type to string.
process.TryGetProcessName(out int parentProcessName);
src/tests/Common/Coreclr.TestWrapper/CoreclrTestWrapperLib.cs:864
- TryGetProcessName outputs a string for activeProcessName here, which is inconsistent with its usage earlier where an int was expected; please ensure both usages align with the correct process name type.
activeProcess.TryGetProcessName(out string activeProcessName);
Contributor
|
Tagging subscribers to this area: @hoyosjs |
Member
Author
|
Continuation of #113937 Motivate by failure seen in #115602 |
jkoritzinsky
approved these changes
May 16, 2025
jkotas
commented
May 16, 2025
hoyosjs
approved these changes
May 16, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.