Skip to content

[Testing] Add diagnostics to GetProcessTmpDir test to investigate CI failure#5751

Open
mdh1418 wants to merge 2 commits intodotnet:mainfrom
mdh1418:fix/flaky-tmpdir-test
Open

[Testing] Add diagnostics to GetProcessTmpDir test to investigate CI failure#5751
mdh1418 wants to merge 2 commits intodotnet:mainfrom
mdh1418:fix/flaky-tmpdir-test

Conversation

@mdh1418
Copy link
Member

@mdh1418 mdh1418 commented Mar 6, 2026

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.

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>
@mdh1418 mdh1418 requested a review from a team as a code owner March 6, 2026 17:24
Copilot AI review requested due to automatic review settings March 6, 2026 17:24
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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}/environ to capture size, permissions, env-var count, and a detected TMPDIR= 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.

noahfalk
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>
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.

3 participants