Skip to content

Comments

HangDump should trigger even after test session finish#7392

Merged
Evangelink merged 5 commits intomainfrom
dev/ygerges/hangdump
Feb 20, 2026
Merged

HangDump should trigger even after test session finish#7392
Evangelink merged 5 commits intomainfrom
dev/ygerges/hangdump

Conversation

@Youssef1313
Copy link
Member

Fixes #7314

@Youssef1313 Youssef1313 marked this pull request as ready for review February 18, 2026 13:15
@Evangelink Evangelink requested a review from Copilot February 18, 2026 13:21
Copy link
Member

@Evangelink Evangelink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be great to create a new acceptance test where we spawn a thread or something and show that now hang dump triggers

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 SessionEndSerializer and its associated request/response handling
  • Removed session end signaling from HangDumpActivityIndicator.OnTestSessionFinishingAsync
  • Simplified disposal logic by removing conditional disposal based on _sessionEndCalled flag

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 _singleConnectionNamedPipeServer resource is created in OnTestSessionStartingAsync (line 96) but is never disposed in Dispose. 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();

@Youssef1313
Copy link
Member Author

It'd be great to create a new acceptance test where we spawn a thread or something and show that now hang dump triggers

@copilot Please add this test.

Copy link
Contributor

Copilot AI commented Feb 18, 2026

@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.

#7429)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Youssef1313 <31348972+Youssef1313@users.noreply.github.com>
Copilot AI review requested due to automatic review settings February 20, 2026 10:40
@Youssef1313 Youssef1313 marked this pull request as ready for review February 20, 2026 10:42
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Copilot AI review requested due to automatic review settings February 20, 2026 11:10
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

@Evangelink Evangelink enabled auto-merge February 20, 2026 11:37
@Evangelink Evangelink merged commit 47afc52 into main Feb 20, 2026
14 checks passed
@Evangelink Evangelink deleted the dev/ygerges/hangdump branch February 20, 2026 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dotnet test hangs after completing tests in project

3 participants