Repository navigation
perf(ci): direct pytest runs wait for a gate slot - #4901
Conversation
A direct uv run pytest with the addopts -n logical took no gate slot, so it started one xdist worker for each CPU beside a devops ci gate that held the only slot. - gate_slot sets DEVOPS_CLI_GATE_SLOT_HELD=1 while it holds a slot, so the pytest that a gate starts takes no second slot. - direct_run_slot holds a slot for a pytest run that no holder started, and gives at most the CPUs of the process over the number of slots. - The root conftest wraps pytest_xdist_auto_num_workers, which xdist calls only for -n logical or -n auto, and caps the count of xdist. - CONTRIBUTING.md and docs/TESTING.md say which pytest runs take a slot.
Proof and measurementsBefore ( After (this branch): a scratch data directory (
The wait line of A: CI: the job count and the runner-min do not change. The Cost: the hook adds one Checks
Owner stepsNone. The change needs no setting, cluster or repository change. |
CI and in-image results
|
🤖 I have created a release *beep* *boop* --- ## [0.115.0](v0.114.1...v0.115.0) (2026-11-12) ### Features * **design:** add the design tokens and their build ([#4811](#4811)) ([db4b19a](db4b19a)) * **roadmap:** find symbol definitions with tree-sitter ([#4820](#4820)) ([3b3fddc](3b3fddc)) ### Bug Fixes * **ai:** the gateway group that answered decides the local label ([#4907](#4907)) ([0da637f](0da637f)) * **ci:** replay a changed gate check in fail-to-pass ([#4898](#4898)) ([59bfc57](59bfc57)) * **config:** read each config file as YAML 1.2 ([#4858](#4858)) ([c3130a3](c3130a3)) * **roadmap:** loosen the caps that turn a stage refusal into a loss ([#4869](#4869)) ([4492fc3](4492fc3)) * **roadmap:** refine reads a dependency named by title ([#4877](#4877)) ([2829f9c](2829f9c)) * **roadmap:** refine sends a judge refusal to an agent round ([#4874](#4874)) ([e4fc6a9](e4fc6a9)) * **tests:** refuse test writes under the real home ([#4857](#4857)) ([0f6ac1b](0f6ac1b)) * **tests:** the plain-Python helper test keeps PYTHONPATH ([#4914](#4914)) ([99c109d](99c109d)) ### Performance Improvements * **ci:** direct pytest runs wait for a gate slot ([#4901](#4901)) ([e80db62](e80db62)) * **roadmap:** status lane reads the snapshot, skips idle stops ([#4887](#4887)) ([f285cf8](f285cf8)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
A direct
uv run pytestwith the-n logicalofaddoptstook no gate slot. On the shared host it started one xdist worker for each CPU beside adevops cigate that held the only slot, so the gate ran 3 to 6 times slower and hit its timeout.gate_slotsetsDEVOPS_CLI_GATE_SLOT_HELD=1while it holds a slot, so the pytest of a gate takes no second slot.direct_run_slotholds a slot for a pytest run that no holder started, and gives at most the CPUs of the process over the number of slots.pytest_xdist_auto_num_workers. xdist calls it only for-n logicalor-n auto, beforepytest_configure. A run with an explicit-nor--collect-onlytakes no slot.CONTRIBUTING.mdanddocs/TESTING.mdsay which runs take a slot.Closes #4525
Change:
openspec/changes/archive/2026-11-12-4525-direct-pytest-runs-ignore-the-gate/