[Testing] Add diagnostics to GetProcessTmpDir test to investigate CI failure#5751
Open
mdh1418 wants to merge 2 commits intodotnet:mainfrom
Open
[Testing] Add diagnostics to GetProcessTmpDir test to investigate CI failure#5751mdh1418 wants to merge 2 commits intodotnet:mainfrom
mdh1418 wants to merge 2 commits intodotnet:mainfrom
Conversation
The test fails on Ubuntu 22.04 CI with environ readable but TMPDIR not matching the custom value. Add diagnostic output to the assertion messages to capture: environ byte size, env var count, raw TMPDIR entry, parent TMPDIR, ProcessStartInfo TMPDIR, file permissions, child exit state, current user, and first 200 bytes of environ content. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds additional diagnostics to the Linux behavioral test covering PidIpcEndpoint.GetProcessTmpDir to help investigate CI failures where /proc/{pid}/environ appears readable but TMPDIR does not match the expected custom value.
Changes:
- Adds manual reading/parsing of
/proc/{pid}/environto capture size, permissions, env-var count, and a detectedTMPDIR=entry. - Expands assertion failure messages with additional runtime diagnostics (parent TMPDIR, child state, username, etc.).
- Changes the test’s assertion logic to require
environReadable == true.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/tests/Microsoft.Diagnostics.NETCore.Client/PidIpcEndpointTests.cs
Outdated
Show resolved
Hide resolved
src/tests/Microsoft.Diagnostics.NETCore.Client/PidIpcEndpointTests.cs
Outdated
Show resolved
Hide resolved
src/tests/Microsoft.Diagnostics.NETCore.Client/PidIpcEndpointTests.cs
Outdated
Show resolved
Hide resolved
src/tests/Microsoft.Diagnostics.NETCore.Client/PidIpcEndpointTests.cs
Outdated
Show resolved
Hide resolved
noahfalk
previously approved these changes
Mar 8, 2026
- Wrap File.ReadAllBytes in try/catch so test doesn't crash before reaching assertions on systems with restricted /proc permissions - Handle environReadable==false gracefully: assert fallback value instead of hard-failing - Remove incorrect unused variable (ProcessId instead of UID) - Fix 'first 200 bytes' label to 'first 200 chars' - Stress tested 129 runs over 30 minutes with no failures locally; issue appears to be CI-environment-specific Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Investigating #5750
The test fails on Ubuntu 22.04 CI with environ readable but TMPDIR not matching the custom value. Add diagnostic output to the assertion messages to capture: environ byte size, env var count, raw TMPDIR entry, parent TMPDIR, ProcessStartInfo TMPDIR, file permissions, child exit state, current user, and first 200 bytes of environ content.