"The active test run was aborted ... test host process crashed" in CI
The VSTest host process died while running tests, so the run was aborted. Causes range from deterministic crashes (stack overflow, an unhandled native exception, a process-killing test) to transient ones (out-of-memory pressure or an environment blip on the runner). Self-healing managed runners like Latchkey auto-retry runs aborted by transient infrastructure failures, so a one-off host crash from a resource blip does not necessarily fail the pipeline.
What this error means
The dotnet test run aborts with "Test host process crashed", often with no per-test result for the offending test. May reproduce deterministically (a crashing test) or appear intermittently (resource pressure).
The active test run was aborted. Reason: Test host process crashed
Aborting test run: number of data points is 0.Common causes
A test crashes the process
A stack overflow, an unhandled exception on a background thread, or a native interop fault kills the host rather than failing a single test.
Resource pressure or a transient runner blip
Out-of-memory conditions or a momentary environment issue can abort the host non-deterministically.
How to fix it
Isolate and fix the crashing test
- Collect a crash dump (
--blame-crash) to identify the failing test/stack. - Fix the offending code (avoid unbounded recursion, handle background-thread exceptions).
- Re-run.
dotnet test --blame-crash --blame-hang-timeout 5mReduce resource pressure / retry transient aborts
- Lower test parallelism or give the runner more memory if it is OOMing.
- For genuinely transient aborts, re-run the job; managed self-healing runners retry these automatically.
- Re-run.
How to prevent it
- Run with
--blame-crashin CI to capture dumps on host crashes. - Cap parallelism and memory use so the host does not OOM.
- Run CI on self-healing managed runners that auto-retry transient aborts.