Skip to content

Synchronize TMPDIR test child startup - #6250

Merged
hoyosjs merged 1 commit into
mainfrom
steveisok-tmpdir-startup-race
Nov 15, 2026
Merged

hoyosjs merged 1 commit into
mainfrom
steveisok-tmpdir-startup-race

Conversation

@steveisok

Copy link
Copy Markdown
Member

Summary

Replace the nonempty /proc/{pid}/environ poll in GetProcessTmpDir_ChildProcess_ReadsTmpdir with a child-written readiness signal. The test starts a shell that prints ready and then waits on redirected stdin, so the parent reads the environment only after the child has executed. Startup is bounded by a 30-second timeout; existing TMPDIR assertions, diagnostics, fallback behavior, and child cleanup are preserved.

A nonempty environment is not a reliable startup marker: before exec, it can still contain the parent's environment. A forced fork/exec window reproduced the original failure signature. The precise trigger in CI remains unconfirmed; natural stress did not reproduce it.

Test-only change; production code and the ClrMD dependency update in #6246 are unchanged. Relates to #5750.

Validation

  • Endpoint tests passed on Linux arm64 with glibc/.NET 10.0.15 and Alpine musl/.NET 11: 13 passed, 2 expected skips each.
  • Under identical fault injection (fork semantics, failed best-effort exec-completion pipe, and a 100 ms exec delay), the exact original test source failed 20/20 calls; the fixed test passed 100/100.
  • Fixed test passed 5,000 normal glibc calls and 1,000 musl calls.
  • Negative controls confirmed that removing TMPDIR still fails and withholding readiness times out. No unreaped child processes remained.

Wait for a child-written readiness signal before reading its /proc environment instead of polling for nonempty data. Keep the child alive through redirected stdin and bound startup with a timeout.

Co-authored-by: Copilot App <[email protected]>
@steveisok
steveisok requested a review from a team as a code owner November 15, 2026 01:23
@hoyosjs
hoyosjs merged commit 2a3cfe2 into main Nov 15, 2026
25 checks passed
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.

2 participants