Skip to content

Fix HangDump artifact paths for Windows directories with spaces - #8513

Merged
Amaury Levé (Evangelink) merged 7 commits into
mainfrom
copilot/fix-hangdump-artifact-paths
May 25, 2026
Merged

Amaury Levé (Evangelink) merged 7 commits into
mainfrom
copilot/fix-hangdump-artifact-paths

Conversation

Copilot AI commented May 22, 2026 •

Copy link
Copy Markdown
Contributor

HangDump quoted dump paths before calling DiagnosticsClient.WriteDump on Windows, then reused that quoted string for artifact publication. This produced FileArtifact paths containing literal quotes, which do not point to the dump file on disk.

  • Path handling
    • Split dump path handling into two values:
      • quoted path for the Windows WriteDump workaround
      • unquoted path for _dumpFiles and artifact publication
DumpFileNames dumpFileNames = GetDumpFileNames(finalDumpFileName);

diagnosticsClient.WriteDump(dumpType.Value, dumpFileNames.WriteDumpFileName, logDumpGeneration: false);
_dumpFiles.Add(dumpFileNames.ArtifactDumpFileName);
  • Regression coverage
    • Added unit coverage for a Windows dump path containing spaces.
    • Verifies only the WriteDump argument is quoted and the artifact path remains unquoted.

Copilot AI self-assigned this May 22, 2026
Copilot AI review requested due to automatic review settings May 22, 2026 16:03
Copilot AI removed the request for review from Copilot May 22, 2026 16:03
Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot May 22, 2026 16:29
Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot May 22, 2026 16:31
Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot May 22, 2026 16:34
Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot May 22, 2026 16:35
Copilot AI changed the title [WIP] Fix HangDump artifact paths on Windows Fix HangDump artifact paths for Windows directories with spaces May 22, 2026
The 1-arg overload is only called inside the #if NETCOREAPP branch, so
on netstandard2.0 it triggered IDE0051 (unused private member) and
failed the Release build. Wrap the helper in the same #if block to
match the call site.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 23, 2026 15:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 HangDump dump-file path handling on Windows when the results directory contains spaces by separating the “quoted for DiagnosticsClient.WriteDump” path from the unquoted path used for artifact tracking/publication.

Changes:

  • Introduced a DumpFileNames helper to produce a quoted dump path only for the WriteDump call, while preserving an unquoted path for _dumpFiles and artifact publication.
  • Added a unit test verifying the quoting behavior for a Windows-style path containing spaces.
Show a summary per file
File Description
test/UnitTests/Microsoft.Testing.Extensions.UnitTests/HangDumpTests.cs Adds regression test asserting only the WriteDump argument is quoted while the artifact path remains unquoted.
src/Platform/Microsoft.Testing.Extensions.HangDump/HangDumpProcessLifetimeHandler.cs Refactors dump path handling to avoid publishing artifact paths containing literal quotes on Windows.

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 0

@Evangelink
Amaury Levé (Evangelink) marked this pull request as ready for review May 23, 2026 15:44
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Evangelink
Amaury Levé (Evangelink) merged commit f01995d into main May 25, 2026
25 checks passed
@Evangelink
Amaury Levé (Evangelink) deleted the copilot/fix-hangdump-artifact-paths branch May 25, 2026 11:22
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.

[MTP Diagnostic Analysis] HangDump publishes quoted dump paths as artifacts on Windows

4 participants