Speed up blame tests by filtering non-.NET processes from dump collection#15518
Conversation
…tion - Filter conhost/WerFault/createdump from NetClientHangDumper process tree, avoiding 30s DiagnosticsClient timeout per non-.NET process - Apply same createdump filter to WindowsHangDumper - Add HangDumpType=mini where hang dump defaulted to Full - Reduce child-crash/child-hang process tree from 3 to 2 children Results: - HangDumpChildProcesses: 39.4s -> 16.1s (59% faster) - CrashDumpChildProcesses: 32.3s -> 17.9s (45% faster) - CrashDumpWhenThereIsNoTimeout: 62.4s -> 39.7s (36% faster) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR speeds up blame/hang dump collection by avoiding attempts to collect dumps from known non-.NET helper processes, which prevents repeated 30s DiagnosticsClient timeouts and reduces overall test runtime.
Changes:
- Filter out
conhost,WerFault, andcreatedumpfrom dump collection process trees. - Fix hang dump configuration to explicitly use mini dumps where it previously defaulted to full.
- Simplify child process trees in test assets to reduce dump count and execution time.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| test/TestAssets/child-hang/UnitTest1.cs | Reduces hang test child process depth and adjusts expected dump count/comments. |
| test/TestAssets/child-crash/UnitTest1.cs | Reduces crash test child process depth and adjusts expected dump count/comments. |
| test/Microsoft.TestPlatform.TestUtilities/IntegrationTestBuild.cs | Splits timing logs for unzip/build/compatibility build steps. |
| test/Microsoft.TestPlatform.Acceptance.IntegrationTests/BlameDataCollectorTests.cs | Adjusts blame args (mini hang dumps) and test target frameworks; adds diagnostic logging. |
| src/Microsoft.TestPlatform.Extensions.BlameDataCollector/WindowsHangDumper.cs | Extends helper-process filter to include createdump. |
| src/Microsoft.TestPlatform.Extensions.BlameDataCollector/NetClientHangDumper.cs | Filters non-.NET helper processes before using DiagnosticsClient; fixes verbose log to use correct PID. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: Jakub Jareš <me@jakubjares.com>
There was a problem hiding this comment.
Pull request overview
This PR optimizes blame/hang dump collection tests by avoiding dump attempts against known non-.NET helper processes that trigger DiagnosticsClient timeouts, and updates associated test assets/config to reduce overall runtime.
Changes:
- Filter non-.NET processes (e.g., conhost/WerFault/createdump) out of process-tree dump collection to avoid per-process 30s timeouts.
- Explicitly set hang dump type to mini in
CrashDumpWhenThereIsNoTimeoutand reduce child process fan-out in test assets. - Adjust test coverage scope/target frameworks and refine integration build timing logs.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| test/TestAssets/child-hang/UnitTest1.cs | Reduce hanging process tree depth (2 procs instead of 3) and update expected dump count comments. |
| test/TestAssets/child-crash/UnitTest1.cs | Reduce crashing process tree depth (2 procs instead of 3) and update expected dump count comments. |
| test/Microsoft.TestPlatform.TestUtilities/IntegrationTestBuild.cs | Split build/unzip timing logs into more granular steps. |
| test/Microsoft.TestPlatform.Acceptance.IntegrationTests/BlameDataCollectorTests.cs | Force HangDumpType=mini and narrow HangDumpChildProcesses runner target. |
| src/Microsoft.TestPlatform.Extensions.BlameDataCollector/WindowsHangDumper.cs | Exclude createdump from hang dump process-tree enumeration on Windows. |
| src/Microsoft.TestPlatform.Extensions.BlameDataCollector/NetClientHangDumper.cs | Exclude non-.NET helper processes from process tree before using DiagnosticsClient; fix verbose log to use child proc ID. |
…ataCollectorTests.cs
|
Passsed windows build |
There was a problem hiding this comment.
Pull request overview
Speeds up blame/hang dump tests by avoiding dump attempts against known non-.NET helper processes (which trigger DiagnosticsClient timeouts), and adjusts test assets/config to reduce unnecessary dump collection and process-tree depth.
Changes:
- Filter
conhost/WerFault/createdumpout of hang/crash process trees before collecting dumps. - Set
HangDumpType=miniwhere hang dumps were implicitly full. - Reduce child test asset process-tree depth and refine build timing logs.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| test/TestAssets/child-hang/UnitTest1.cs | Reduces hanging process tree depth and updates expectations/comments. |
| test/TestAssets/child-crash/UnitTest1.cs | Reduces crash process tree depth and updates expectations/comments. |
| test/Microsoft.TestPlatform.TestUtilities/IntegrationTestBuild.cs | Splits timing logs for unzip/build/compat steps. |
| test/Microsoft.TestPlatform.Acceptance.IntegrationTests/BlameDataCollectorTests.cs | Forces mini hang dumps in CrashDumpWhenThereIsNoTimeout args; removes TODO. |
| src/Microsoft.TestPlatform.Extensions.BlameDataCollector/WindowsHangDumper.cs | Filters createdump from process tree before dump. |
| src/Microsoft.TestPlatform.Extensions.BlameDataCollector/NetClientHangDumper.cs | Filters native helper processes from process tree; fixes verbose log process id. |
| else | ||
| { | ||
| Debug.WriteLine("BuildCompatibility parameter is false, skipping build."); | ||
| } |
| { | ||
| var process = Process.GetProcessById(processId); | ||
| var processTree = process.GetProcessTree().Where(p => p.Process?.ProcessName is not null and not "conhost" and not "WerFault").ToList(); | ||
| var processTree = process.GetProcessTree().Where(p => p.Process?.ProcessName is not null and not "conhost" and not "WerFault" and not "createdump").ToList(); |
| // There is 30s timeout hardcoded for the NetClient, so if we try to connect to a non-net process it will take 30s to timeout. | ||
| // https://github.com/dotnet/diagnostics/blob/main/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcClient.cs#L15 | ||
| // We run this in parallel so it okay, but we are never interested in dumping the native helper processes of Windows, nor we can dump them. | ||
| var processTree = process.GetProcessTree().Where(p => p.Process?.ProcessName is not null and not "conhost" and not "WerFault" and not "createdump").ToList(); |
| var processTree = process.GetProcessTree(); | ||
| // There is 30s timeout hardcoded for the NetClient, so if we try to connect to a non-net process it will take 30s to timeout. | ||
| // https://github.com/dotnet/diagnostics/blob/main/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcClient.cs#L15 | ||
| // We run this in parallel so it okay, but we are never interested in dumping the native helper processes of Windows, nor we can dump them. |
| var processTree = process.GetProcessTree(); | ||
| // There is 30s timeout hardcoded for the NetClient, so if we try to connect to a non-net process it will take 30s to timeout. | ||
| // https://github.com/dotnet/diagnostics/blob/main/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcClient.cs#L15 | ||
| // We run this in parallel so it okay, but we are never interested in dumping the native helper processes of Windows, nor we can dump them. |
Summary
Speeds up blame/hang dump tests by filtering out non-.NET processes (\conhost, \WerFault, \createdump) from the process tree before attempting dump collection. This avoids the 30s DiagnosticsClient timeout that occurs when trying to connect to native processes.
Also fixes the implicit full hang dump in \CrashDumpWhenThereIsNoTimeout\ and reduces child process tree depth.
Changes
Results