Report PID-qualified testhost controller pipe env var#8498
Open
Copilot wants to merge 3 commits into
Open
Conversation
Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix pipe connection failure error message
Report PID-qualified testhost controller pipe env var
May 22, 2026
Evangelink
approved these changes
May 22, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a startup diagnostic in Microsoft.Testing.Platform where a missing testhost-controller pipe-name error reported the wrong environment variable key, and adds a unit test to prevent regressions.
Changes:
- Update the thrown exception message to include the PID-qualified environment variable name that was actually read.
- Add a unit test asserting the exception message contains the PID-qualified key when the pipe name is missing.
Show a summary per file
| File | Description |
|---|---|
| test/UnitTests/Microsoft.Testing.Platform.UnitTests/TestHostBuilderTests.cs | Adds regression test verifying the PID-qualified env-var name is present in the thrown exception message. |
| src/Platform/Microsoft.Testing.Platform/Hosts/TestHostBuilder.Utilities.cs | Fixes the exception message to report the PID-qualified pipe env-var key instead of the base constant. |
Copilot's findings
- Files reviewed: 2/2 changed files
- Comments generated: 2
| SystemEnvironment environment) | ||
| { | ||
| using CTRLPlusCCancellationTokenSource cancellationTokenSource = new(); | ||
| var connectTask = (Task)method.Invoke(null, [cancellationTokenSource, new NopLogger(), testHostControllerInfo, configuration, environment])!; |
|
|
||
| try | ||
| { | ||
| MethodInfo method = typeof(TestHostBuilder).GetMethod("ConnectToTestHostProcessMonitorIfAvailableAsync", BindingFlags.NonPublic | BindingFlags.Static)!; |
Member
|
@copilot address review comments |
Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When the testhost controller pipe-name lookup failed, the error reported the base environment variable instead of the PID-qualified key that was actually read. This made startup diagnostics point at the wrong variable.
TESTINGPLATFORM_TESTHOSTCONTROLLER_PIPENAME_<pid>key in the missing pipe-name exception.