Skip to content

Tie the .NET Framework fixture host to the test host's lifetime - #4032

Merged
christophwille merged 1 commit into
masterfrom
netfx-fixture-host-lifetime
Aug 19, 2026
Merged

Tie the .NET Framework fixture host to the test host's lifetime#4032
christophwille merged 1 commit into
masterfrom
netfx-fixture-host-lifetime

Conversation

@christophwille

Copy link
Copy Markdown
Member

Hardening only, no behaviour change in green runs.

NetFrameworkProcessesTests starts a Windows PowerShell 5.1 process as the .NET Framework process it inspects. That host used to sleep for a fixed 300 s, which is a wall clock for a slow or starved machine to outrun: on a loaded CI runner the fixture's process walks got slow enough that the host exited mid-fixture and the remaining tests failed for the wrong reason (seen on #3940's Windows jobs). It also left an orphaned powershell.exe whenever the teardown never ran.

Wait-Process -Id <test host PID> ties the host to the test host's lifetime instead: no wall clock to outrun, and the host disappears with the test host even without teardown.

Split out of #3940, where it was noted as optional hardening; the process-walk slowness itself is a separate topic (#4012, and the server-GC follow-up PR).

🤖 Generated with Claude Code

The PowerShell host used to sleep for a fixed 300 s, so any run in which
the process walks got slow (as happened on a starved CI runner) lost the
host mid-fixture and failed the remaining tests for the wrong reason.
Waiting on the test host's PID makes the fixture independent of wall
clock and also guarantees the host disappears with the test host even
if the teardown never runs.

Assisted-by: Claude:claude-fable-5:Claude Code
@christophwille
christophwille force-pushed the netfx-fixture-host-lifetime branch from bad5ec7 to 4089f11 Compare August 19, 2026 12:34
@christophwille
christophwille merged commit a546eae into master Aug 19, 2026
15 checks passed
@christophwille
christophwille deleted the netfx-fixture-host-lifetime branch August 19, 2026 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant