Repository navigation
[fix] Include testhost process path in crash error messages #16108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
beb279d
Include testhost process path in crash error messages
nohwnd ca86acf
fix: preserve timeout diagnostics in ThrowExceptionOnConnectionFailure
nohwnd 2aaace0
refactor: remove redundant comment in ThrowExceptionOnConnectionFailure
nohwnd e52c37d
resolving copilot comments
azat-msft da05c88
attempt to fix pipeline: tests update
azat-msft 9265d38
fix: update test assertions to match new 'Process path:' error format
nohwnd 6e50b54
fix: add missing space separator before 'Process path:' in timeout meβ¦
nohwnd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Error Reporting β Diagnostic Regression] The
|| !StringUtils.IsNullOrWhiteSpace(_testHostProcessFileName)addition causes this condition to fire on every launch attempt, not just on crashes._testHostProcessFileNameis set unconditionally at line 235 (beforeLaunchTestHostAsync) and is never reset. This means the condition istruewhenever any testhost has been launched, regardless of whether it actually crashed.Consider the normal connection-timeout path (testhost running, never connected):
_testHostExited.IsSet=falseβThrowOnTestHostExiteddoesn't throw, falls through to here_testHostProcessStdError=""(reset at start ofSetupChannel, never updated since host didn't exit)_testHostProcessFileName="dotnet"or"testhost.exe"β always truthyResult: the informative timeout message (including process ID, elapsed seconds, and the environment variable hint) is overwritten with:
The user sees a misleading "exited with error" message even though the process never exited β it just timed out.
Suggested fix: Keep the condition unchanged and instead append the path as context to the existing error messages, or scope the path to the
errorMsgaddendum only:This preserves the existing diagnostic clarity for timeout scenarios while still surfacing the process path when it's the only available context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. The
||condition has been split into two cases:errorMsgwithTestHostExitedWithError(crash path, unchanged behavior)" Process path: {_testHostProcessFileName}"as an addendum to the existing timeout message, preserving the elapsed-seconds/process-ID/VSTEST_CONNECTION_TIMEOUThintThis ensures connection-timeout diagnostics are never overwritten by a misleading "exited with error" message.