HangDump should trigger even after test session finish#7392
Conversation
Evangelink
left a comment
There was a problem hiding this comment.
It'd be great to create a new acceptance test where we spawn a thread or something and show that now hang dump triggers
There was a problem hiding this comment.
Pull request overview
This PR fixes a hang issue (#7314) where dotnet test hangs after completing tests when running multiple test projects in a solution with MSTest SDK 4.0.2. The fix removes the session end coordination mechanism between the test host process and the parent process.
Changes:
- Removed
SessionEndSerializerand its associated request/response handling - Removed session end signaling from
HangDumpActivityIndicator.OnTestSessionFinishingAsync - Simplified disposal logic by removing conditional disposal based on
_sessionEndCalledflag
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| SessionEndSerializer.cs | Entire file deleted - removes the session end serializer that was used for coordination between test host and parent process |
| HangDumpProcessLifetimeHandler.cs | Removed session end request handling and conditional activity timer disposal logic |
| HangDumpActivityIndicator.cs | Removed session end signaling in OnTestSessionFinishingAsync and simplified disposal by removing conditional cleanup logic |
Comments suppressed due to low confidence (1)
src/Platform/Microsoft.Testing.Extensions.HangDump/HangDumpActivityIndicator.cs:196
- The
_singleConnectionNamedPipeServerresource is created inOnTestSessionStartingAsync(line 96) but is never disposed inDispose. This creates a resource leak that could cause hangs or prevent proper cleanup. The server should be disposed to ensure the named pipe resources are properly released.
public void Dispose()
=> _namedPipeClient?.Dispose();
src/Platform/Microsoft.Testing.Extensions.HangDump/HangDumpActivityIndicator.cs
Show resolved
Hide resolved
@copilot Please add this test. |
|
@Youssef1313 I've opened a new pull request, #7429, to work on those changes. Once the pull request is ready, I'll request review from you. |
cedc3ca to
a839514
Compare
#7429) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Youssef1313 <31348972+Youssef1313@users.noreply.github.com>
Fixes #7314