From dcf7c9bb8a6f317f13c587d868a5c2d9c547e928 Mon Sep 17 00:00:00 2001 From: MSCodeBase Agent Date: Sat, 26 Sep 2026 11:14:54 +0300 Subject: [PATCH] perf(ci): parallelize the clean-state suite too clean-state was the last long CI job (~13m) after the test job dropped to ~2m with pytest-xdist. Its test selection is identical to the test job: no file list, and pyproject addopts keep `-m 'not slow and not benchmark'` (98 deselected). The same parallel run already passed on ubuntu+windows, so parallel safety is proven; locally it is 197s -> 71s (12 cores). The fresh venv, lockfile-drift gate (+ its negative control), the negative-controls inventory and the revision gate are all unchanged. --- scripts/verify_clean_state.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/verify_clean_state.sh b/scripts/verify_clean_state.sh index e9255b47..0c18a301 100644 --- a/scripts/verify_clean_state.sh +++ b/scripts/verify_clean_state.sh @@ -133,8 +133,13 @@ else || { echo -e "${RED}PIP INSTALL FAILED${NC}"; exit 1; } fi -echo "Running full test suite (no filters)..." -RESULT=$("$VENV_BIN/python" -m pytest tests/ -q --tb=short 2>&1) +echo "Running full test suite (no filters, parallel)..." +# -n auto (pytest-xdist, dev dep): SAME selection as before — no file list, and +# pyproject addopts keep `-m 'not slow and not benchmark'` — only spread across +# cores. This is exactly the set the `test` job runs (and which passed in +# parallel on ubuntu+windows), so parallel safety is already proven. Measured +# locally: 197s -> 71s (12 cores); CI runners have 4 cores. No quality loss. +RESULT=$("$VENV_BIN/python" -m pytest tests/ -q --tb=short -n auto 2>&1) EXIT_CODE=$? PASSED=$(echo "$RESULT" | grep -oE '[0-9]+ passed' | head -1 | grep -oE '[0-9]+' || echo "0")