Cleanup and simplify hang dump implementation#7700
Conversation
There was a problem hiding this comment.
Pull request overview
This PR simplifies the hang dump named-pipe environment variable naming by removing the application-path-based hash and using only a random per-run suffix, reducing coupling to ITestApplicationModuleInfo.
Changes:
- Remove the FNV-1a string hash helper previously used for pipe env-var key generation.
- Simplify
HangDumpConfiguration.PipeNameKeytoTESTINGPLATFORM_HANGDUMP_PIPENAME_<namedPipeSuffix>and align the activity indicator’s lookup logic. - Simplify hang dump extension setup by removing unnecessary
CurrentTestApplicationModuleInfoconstruction.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/Platform/Microsoft.Testing.Extensions.HangDump/Helpers/FNV1HashHelper.cs | Removes the now-unused hash helper. |
| src/Platform/Microsoft.Testing.Extensions.HangDump/HangDumpExtensions.cs | Stops constructing module-info solely for hashing; uses simplified configuration ctor. |
| src/Platform/Microsoft.Testing.Extensions.HangDump/HangDumpConfiguration.cs | Updates pipe env-var key generation to use only the random suffix. |
| src/Platform/Microsoft.Testing.Extensions.HangDump/HangDumpActivityIndicator.cs | Updates pipe env-var lookup to match the simplified naming scheme. |
src/Platform/Microsoft.Testing.Extensions.HangDump/HangDumpConfiguration.cs
Outdated
Show resolved
Hide resolved
src/Platform/Microsoft.Testing.Extensions.HangDump/HangDumpActivityIndicator.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Evangelink
left a comment
There was a problem hiding this comment.
Clean, well-scoped simplification. The old hash-based env var naming (TESTINGPLATFORM_HANGDUMP_PIPENAME_<hash>_<suffix> + a separate suffix env var) was unnecessary complexity — the pipe name itself is already a unique GUID. Collapsing to a single TESTINGPLATFORM_HANGDUMP_PIPENAME env var, removing HangDumpConfiguration, FNV_1aHashHelper, and ExitSignalActivityIndicatorTaskRequest removes 3 files and ~73 net lines while making the code easier to follow. The DESIGN.md is a valuable addition.
One minor nit about inconsistent GetPipeName overload usage (see inline). No blocking issues — all changed types are internal, so no public API surface concerns.
No description provided.