-
Notifications
You must be signed in to change notification settings - Fork 323
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
Dumping child processes #2518
Dumping child processes #2518
Conversation
src/Microsoft.TestPlatform.Extensions.BlameDataCollector/ProcessCodeMethods.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.TestPlatform.Extensions.BlameDataCollector/ProcessCodeMethods.cs
Show resolved
Hide resolved
foreach (var p in bottomUpTree) | ||
{ | ||
try | ||
{ | ||
EqtTrace.Verbose($"NetClientHangDumper.Dump: Killing process {p.Id} - {p.ProcessName}."); | ||
p.Kill(); | ||
} | ||
catch (Exception ex) | ||
{ | ||
EqtTrace.Error($"NetClientHangDumper.Dump: Error killing process {p.Id} - {p.ProcessName}: {ex}."); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would not be better to place it in separate method? Or can we combine all three for-each loops in one and execute methods in chain? Will that work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For better refactoring :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactor for better refactoring?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To have better refactored code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but how adding a method helps the code to be better? It invokes a single method in between logging. This imho reads okay, and the log will be easier to parse. - Will adding a method outweight this benefit?
src/Microsoft.TestPlatform.Extensions.BlameDataCollector/NetClientHangDumper.cs
Show resolved
Hide resolved
src/Microsoft.TestPlatform.Extensions.BlameDataCollector/ProcessCodeMethods.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.TestPlatform.Extensions.BlameDataCollector/ProcessCodeMethods.cs
Outdated
Show resolved
Hide resolved
Hello @nohwnd! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
Description
Allow child processes to be crash and hang dumped on Windows, MacOS and Linux. Dumps are by default generated to %TEMP%\guid and all generated dumps are collected from that folder. Unlike before where we told the tool the exact path for the dump and then looked just for that file.
Related issue
#2498