mirror of
https://github.com/Akkudoktor-EOS/EOS.git
synced 2026-11-25 15:06:20 +01:00
build(make): cap the parallel workers of test-ci
test-ci ran the tests without a server with `-n auto`, one pytest-xdist worker per core. On a machine with 32 cores and 16 GB of memory this exhausted the threads (Windows, `RuntimeError: can't start new thread`) or the memory (WSL); with eight workers all parts passed (reported in the review of this pull request). The target now adds `--maxprocesses=$(TEST_CI_MAX_WORKERS)` with a default of 8, so it still starts one worker per core, but at most eight. `make test-ci TEST_CI_MAX_WORKERS=<n>` changes the limit. CI is not affected: its jobs call pytest themselves, on runners with four cores. Additional changes Describe the limit, `--maxprocesses` and `PYTEST_XDIST_AUTO_NUM_WORKERS` in the developer documentation Refs #1553 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Assisted-by: Claude Code (claude-fable-5-2)
This commit is contained in:
committed by
Bobby Noelte
co-authored by
Claude Fable 5.2
parent
57905b2024
commit
4b15419b4d
@@ -137,15 +137,18 @@ test:
|
||||
$(PYTEST) -vs --cov src --cov-report term-missing
|
||||
|
||||
# Target to run tests as done by CI on Github (.github/workflows/pytest.yml), one part after
|
||||
# the other: the server tests (test-server), the other tests on all cores (test-shard, without
|
||||
# the other: the server tests (test-server), the other tests in parallel (test-shard, without
|
||||
# splitting them into shards), the Sphinx build (docs-test) and the Docker checks (docker-test).
|
||||
# Every test runs once. The coverage report covers the first two parts, like the test job.
|
||||
# The browser tests (browser-test) have their own target test-browser.
|
||||
# The parallel part starts one pytest-xdist worker per core, but at most TEST_CI_MAX_WORKERS:
|
||||
# one worker per core runs out of memory or threads on machines with many cores.
|
||||
TEST_CI_MAX_WORKERS ?= 8
|
||||
test-ci: export COVERAGE_CORE := sysmon
|
||||
test-ci:
|
||||
@echo "Running tests as CI..."
|
||||
$(PYTEST) --finalize --check-config-side-effect -m "eos_server and not docs and not docker" -vs --durations=25 --cov src --cov-report=
|
||||
$(PYTEST) --finalize --check-config-side-effect -m "not eos_server and not docs and not docker" -n auto -v --durations=25 --cov src --cov-append --cov-report term-missing
|
||||
$(PYTEST) --finalize --check-config-side-effect -m "not eos_server and not docs and not docker" -n auto --maxprocesses=$(TEST_CI_MAX_WORKERS) -v --durations=25 --cov src --cov-append --cov-report term-missing
|
||||
$(PYTEST) --finalize --check-config-side-effect -m docs -vs
|
||||
$(PYTEST) --finalize --check-config-side-effect -m docker -vs
|
||||
|
||||
|
||||
Reference in New Issue
Block a user