From 4c6e8bcdf0494ae54b7fbcca8b02da2dfb638df3 Mon Sep 17 00:00:00 2001 From: Aaron Jomy Date: Tue, 3 Feb 2026 13:12:32 +0100 Subject: [PATCH] [ci] Run pytests multithreaded --- .github/workflows/MacOS.yml | 2 +- .github/workflows/Ubuntu.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/MacOS.yml b/.github/workflows/MacOS.yml index 2d032aff..8d2149f4 100644 --- a/.github/workflows/MacOS.yml +++ b/.github/workflows/MacOS.yml @@ -558,7 +558,7 @@ jobs: echo ::endgroup:: echo ::group::Run complete test suite set -o pipefail - python -m pytest -v -ra | tee complete_testrun.log 2>&1 + python -m pytest -v -ra -n ${{ env.ncpus }} | tee complete_testrun.log 2>&1 set +o pipefail echo ::group::Crashing Test Logs # See if we don't have a crash that went away diff --git a/.github/workflows/Ubuntu.yml b/.github/workflows/Ubuntu.yml index d7ba0d4f..c4aa8ee2 100644 --- a/.github/workflows/Ubuntu.yml +++ b/.github/workflows/Ubuntu.yml @@ -576,13 +576,13 @@ jobs: echo ::endgroup:: echo ::group::Run complete test suite set -o pipefail - python -m pytest -v -ra | tee complete_testrun.log 2>&1 + python -m pytest -v -ra -n ${{ env.ncpus }}| tee complete_testrun.log 2>&1 set +o pipefail echo ::group::Crashing Test Logs # See if we don't have a crash that went away # Comment out all xfails but the ones that have a run=False condition. find . -name "*.py" -exec sed -i '/run=False/!s/^ *@mark.xfail\(.*\)/#&/' {} \; - python -m pytest -n 1 -m "xfail" --runxfail -v -ra --max-worker-restart 512 | tee test_crashed.log 2>&1 || true + python -m pytest -n ${{ env.ncpus }} -m "xfail" --runxfail -v -ra --max-worker-restart 512 | tee test_crashed.log 2>&1 || true git checkout . echo ::endgroup:: echo ::group::XFAIL Test Logs @@ -616,7 +616,7 @@ jobs: fi export IS_VALGRIND=true if [[ "${{ matrix.Valgrind }}" == "On" ]]; then - valgrind --show-error-list=yes --error-exitcode=1 --track-origins=yes --gen-suppressions=all --suppressions="${SUPPRESSION_FILE}" --suppressions=../etc/valgrind-cppyy-cling.supp python -m pytest -m "not xfail" -v -ra --ignore=test_leakcheck.py + valgrind --show-error-list=yes --error-exitcode=1 --track-origins=yes --gen-suppressions=all --suppressions="${SUPPRESSION_FILE}" --suppressions=../etc/valgrind-cppyy-cling.supp python -m pytest -m "not xfail" -v -ra -n ${{ env.ncpus }} --ignore=test_leakcheck.py fi export RETCODE=+$? unset IS_VALGRIND