Switch language한국어
Back to the list

I Replaced pytest-xdist With 60 Lines of subprocess.Popen. Here's Why.

TL;DR AI

Key summary

2 min read
  1. A flaky Python test suite was traced to shared state leaking across pytest-xdist workers.

  2. The team replaced xdist with a launcher that starts one fresh Python process per test file using subprocess.Popen and bounded parallelism.

  3. This kept runtime manageable while eliminating cross-file leakage and stabilizing CI.

  4. The article also stresses killing entire subprocess trees on timeout to avoid orphaned grandchildren.

Read the original