Repository navigation
ci: run the test suite on four xdist workers - #469
Merged
Merged
Conversation
There was a problem hiding this comment.
🔵 Needs a closer look
No blocking code issues were identified, but successful Linux and Windows parallel-suite CI runs have not yet been established by the supplied evidence.
No open issues 🎉
What changed in this PR
This PR reduces CI test time by running the Linux and Windows full suites on four pytest-xdist workers, addressing #468 while preserving the 80% coverage gate.
Changes:
- Enables four workers for full-suite runs; keeps the Windows docs and native-terminal steps single-process.
- Adds explicit compression-test IDs to prevent timestamp-dependent collection mismatches.
- Updates workflow assertions and documentation; retains existing timeouts.
| File | Description |
|---|---|
tests/test_platforms.py |
Updates Windows command assertions for four workers. |
tests/test_ci_workflow.py |
Pins worker flags and updates the timeout commentary. |
tests/k8s/test_pulse.py |
Gives compression cases stable collection IDs. |
docs/dev/quality-gates.md |
Documents parallel testing and combined coverage. |
.github/workflows/ci.yml |
Enables four workers for Linux and Windows full suites. |
Review effort: Balanced
This was referenced Oct 23, 2026
Every CI test job ran the whole suite in one process. On Python 3.12 the coverage job took 33-50 minutes, past its old 45-minute limit (#454) and within ten minutes of the new 60 on korvid-runners. pytest-xdist was already a dev dependency that nothing ran (#468). The Linux test matrix and the Windows full-suite step now pass -n 4. Hosted runners for public repositories have four vCPUs, and a fixed count keeps a korvid-runners pod, which requests one CPU on a shared eight-vCPU node, from claiming every core. pytest-cov combines the workers' data, so the 80% gate is unchanged. Locally the exact CI command took 8m27s against 27m46s in one process, with the same 92.92% coverage. xdist needs every worker to collect the same IDs. test_pulse.py derived two from gzip.compress() output, whose header carries the time it was written, so collections a second apart disagreed and xdist aborted. Those cases are now named. test_ci_workflow.py and test_platforms.py pin the new commands, and the timeout comment now describes the old single-process duration as history. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The Windows pin only checked that the command started with `uv run pytest -n 4 -q`, so a command that later passed `-n 1` would still pass it while xdist ran one worker, because the last `-n` wins. _xdist_worker_counts now splits the command with shlex and returns every worker count in each spelling pytest accepts (-n 4, -n4, --numprocesses 4, --numprocesses=4), and the pin requires exactly ["4"]. Six cases pin the helper. Appending `-n 1` to the Windows command in ci.yml passed the old pin and fails the new one. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
hellices
force-pushed
the
ci/468-xdist-workers
branch
from
October 23, 2026 15:23
47194c3 to
a19a7f5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #468
Summary
Every CI test job ran the whole suite in one process. On Python 3.12 the coverage job took 33-50 minutes: past its old 45-minute limit (#454), and within ten minutes of the new 60 on
korvid-runners(#460's 3.12 took 49m58s).windows-testtook 27-32 minutes.pytest-xdistwas already a dev dependency that nothing ran.-n 4.korvid-runnerspod from claiming every core: it requests one CPU on a shared eight-vCPU node, andautowould start eight.tests/k8s/test_pulse.pyderived two IDs fromgzip.compress()output, whose header carries the time it was written. Collections a second apart disagreed, and xdist aborted with "Different tests were collected between gw0 and gwN". Those four cases now have explicit IDs. Across two full collections three seconds apart, they were the only IDs that differed.tests/test_ci_workflow.pypins the new commands.tests/test_platforms.pyupdates its pin of the Windows command.quality-gates.mdtable shows the new command.Verification
tests/test_ci_workflow.py::test_the_full_suite_runs_on_four_xdist_workersfailed first on the current command and passes now. It requires the Linux suite command to be exactlyuv run pytest -n 4 --cov --cov-fail-under=80, and the main Windows suite step to start withuv run pytest -n 4 -q.tests/k8s/test_pulse.pytwice two seconds apart now gives identical IDs:gzip-not-compressed,gzip-truncated,gzip-trailing-bytes,br-unsupported.pytest --cov --cov-fail-under=80(before, on 223fea6)pytest -n 4 --cov --cov-fail-under=80(this branch)The first run of the parallel command failed only
tests/test_platforms.py's two pins of the old Windows command, which this branch now updates.Run locally on macOS with Python 3.13 and the frozen lock. Each step ran directly with the project's environment rather than through
make, because this machine cannot sync from PyPI:pytest -p no:tach tests/test_ci_workflow.py tests/test_platforms.py tests/k8s/test_pulse.py tests/test_docs_links.py tests/test_docs_build_config.pypython scripts/check_source_size.pyruff check src/ tests/andruff format --check src/ tests/SKIP=mypy,source-size pre-commit run --files <changed files>mypytach checkThis PR's CI (run 39929214721) is the first Linux and Windows run of the parallel suite, on hosted runners because it changes
.github/. Every required check passed. Job durations against recent hosted runs of the same jobs in one process (#456, #457):test (3.11)test (3.12)test (3.13)windows-testThe 3.12 job's log shows
created: 4/4 workers,13695 passed, 27 skipped in 916.20s, andRequired test coverage of 80% reached. Total coverage: 92.76%, so the gate held across the workers.Checklist
make checkpasses locally.and a fail-closed audit entry, and sensitive reads are still masked.