Commit 46e17a635 for llama.cpp
commit 46e17a6352d586572e91ea937f24029df7d4667b
Author: Georgi Gerganov <ggerganov@gmail.com>
Date: Tue Sep 29 08:20:54 2026 +0300
tests : skip pytest workers when PYTEST_WORKERS=1 (#29610)
Assisted-by: pi:llama.cpp/Qwen3.8-27B
diff --git a/tools/server/tests/tests.sh b/tools/server/tests/tests.sh
index c7d5d7805..fd83b7fd5 100755
--- a/tools/server/tests/tests.sh
+++ b/tools/server/tests/tests.sh
@@ -8,13 +8,19 @@ set -eu
WORKERS="${PYTEST_WORKERS:-4}"
+if [ "${WORKERS}" -eq 1 ]; then
+ WORKER_FLAGS=""
+else
+ WORKER_FLAGS="-n ${WORKERS} --dist=worksteal"
+fi
+
if [ $# -lt 1 ]
then
if [[ "${SLOW_TESTS:-0}" == 1 ]]; then
- pytest --durations=30 -v -x -n "${WORKERS}" --dist=worksteal
+ pytest --durations=30 -v -x ${WORKER_FLAGS}
else
- pytest --durations=30 -v -x -n "${WORKERS}" --dist=worksteal -m "not slow"
+ pytest --durations=30 -v -x ${WORKER_FLAGS} -m "not slow"
fi
else
- pytest --durations=30 -n "${WORKERS}" --dist=worksteal "$@"
+ pytest --durations=30 ${WORKER_FLAGS} "$@"
fi