You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cap pytest-xdist's auto worker count to the container CPU quota
`auto` sizes itself from len(sched_getaffinity(0)) -- the same syscall nproc
uses -- and Kubernetes enforces a pod's CPU limit as a CFS quota rather than an
affinity mask, so neither sees it. On an 8 vCPU OSDC pod that meant 64 workers,
which exhausted the memory limit and got test-arm-backend-no-driver OOMKilled.
pytest-parallelism.sh reads the quota from cgroup v2 or v1 and exports
PYTEST_XDIST_AUTO_NUM_WORKERS, falling back to nproc where there is no quota, so
it is a no-op off OSDC. Sourced from the three scripts that run pytest with
`auto`.
Authored with Claude Code.
0 commit comments