Skip to content

[Tests] GetProcessTmpDir_ChildProcess_ReadsTmpdir fails with Assert.Equal() Failure #5750

@mdh1418

Description

@mdh1418

The GetProcessTmpDir_ChildProcess_ReadsTmpdir unit test (introduced in #5735) fails intermittently on the Ubuntu 22.04 x64 CI leg. The test spawns a child process with TMPDIR=/custom/tmp/test via ProcessStartInfo.Environment, then verifies that GetProcessTmpDir reads
the custom value from /proc/{pid}/environ.

Failure

Assert.Equal() Failure: Strings differ ↓ (pos 1) Expected: "/custom/tmp/test" Actual: "/tmp/" ↑ (pos 1)

The environ file was successfully read (environReadable = true), but the parsed TMPDIR was /tmp/ (the Path.GetTempPath() fallback) instead of the custom value set via ProcessStartInfo.Environment.

Possible Causes

  • Race condition: The child process's /proc/{pid}/environ may not reflect the overridden environment if read before execve completes
  • Empty environ: Some CI configurations may return readable but empty /proc/{pid}/environ
  • Environment propagation: ProcessStartInfo.Environment override may not propagate in certain CI environments

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions