From 82a2bd68e7c273abe553822bb58351aa526029fd Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 28 Oct 2026 10:33:16 +0000 Subject: [PATCH 1/9] fix: support pytest 9.2 fixture manager changes pytest 9.2 replaced the private `FixtureManager._arg2fixturedefs` with `_arg2node2fixturedefs` (pytest-dev/pytest#14984). The `pytest_plugin_registered` hook wrote into `_arg2fixturedefs` to swap pytest-benchmark's `benchmark` fixture for ours, so every `--codspeed` run with pytest-benchmark installed crashed with an AttributeError. On pytest 9.1+, register the override through the public `pytest.register_fixture` API at session start instead. Older pytest keeps the previous `_arg2fixturedefs` swap. pytest-benchmark itself still reads the removed `Node._nodeid` on pytest 9.2, so the two tests that run it without `--codspeed` are marked as non-strict xfail on that combination. Co-Authored-By: Guillaume Lagrange <19265358+GuillaumeLagrange@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 --- src/pytest_codspeed/plugin.py | 64 +++++++++++++++++++++++------------ src/pytest_codspeed/utils.py | 2 ++ tests/conftest.py | 5 +++ tests/test_pytest_plugin.py | 3 ++ 4 files changed, 53 insertions(+), 21 deletions(-) diff --git a/src/pytest_codspeed/plugin.py b/src/pytest_codspeed/plugin.py index 2b50a8b..ced3fd3 100644 --- a/src/pytest_codspeed/plugin.py +++ b/src/pytest_codspeed/plugin.py @@ -23,6 +23,7 @@ from pytest_codspeed.instruments import MeasurementMode, get_instrument_from_mode from pytest_codspeed.utils import ( BEFORE_PYTEST_8_1_1, + HAS_PYTEST_REGISTER_FIXTURE, IS_PYTEST_BENCHMARK_INSTALLED, IS_PYTEST_SPEED_INSTALLED, get_environment_metadata, @@ -181,20 +182,40 @@ def pytest_configure(config: pytest.Config): config.pluginmanager.register(plugin, PLUGIN_NAME) -@pytest.hookimpl() -def pytest_plugin_registered(plugin, manager: pytest.PytestPluginManager): - """ - Patch the benchmark fixture to use the codspeed one if codspeed is enabled and an - alternative benchmark fixture is available - """ - if (IS_PYTEST_BENCHMARK_INSTALLED or IS_PYTEST_SPEED_INSTALLED) and isinstance( - plugin, FixtureManager - ): - fixture_manager = plugin - codspeed_plugin: CodSpeedPlugin = cast( - "CodSpeedPlugin", manager.get_plugin(PLUGIN_NAME) - ) - if codspeed_plugin.is_codspeed_enabled: +def _should_override_benchmark_fixture(config: pytest.Config) -> bool: + if not (IS_PYTEST_BENCHMARK_INSTALLED or IS_PYTEST_SPEED_INSTALLED): + return False + codspeed_plugin = cast( + "CodSpeedPlugin | None", config.pluginmanager.get_plugin(PLUGIN_NAME) + ) + return codspeed_plugin is not None and codspeed_plugin.is_codspeed_enabled + + +if HAS_PYTEST_REGISTER_FIXTURE: + + @pytest.hookimpl(trylast=True) + def pytest_sessionstart(session: pytest.Session): + """ + Override the benchmark fixture of pytest-benchmark/pytest-speed with the + codspeed one. Registered later at the same (session) level, so it wins. + """ + if _should_override_benchmark_fixture(session.config): + pytest.register_fixture( + name="benchmark", func=_benchmark_compat, node=session + ) + +else: + + @pytest.hookimpl() + def pytest_plugin_registered(plugin, manager: pytest.PytestPluginManager): + """ + Patch the benchmark fixture to use the codspeed one if codspeed is enabled and + an alternative benchmark fixture is available + """ + if isinstance(plugin, FixtureManager) and _should_override_benchmark_fixture( + plugin.config + ): + fixture_manager = plugin codspeed_benchmark_fixtures = plugin.getfixturedefs( "codspeed_benchmark", fixture_manager.session.nodeid @@ -433,11 +454,12 @@ def codspeed_benchmark(request: pytest.FixtureRequest) -> Callable: return BenchmarkFixture(request) -if not IS_PYTEST_BENCHMARK_INSTALLED: +def _benchmark_compat(codspeed_benchmark, request: pytest.FixtureRequest): + """ + Compatibility with pytest-benchmark + """ + return codspeed_benchmark - @pytest.fixture(scope="function") - def benchmark(codspeed_benchmark, request: pytest.FixtureRequest): - """ - Compatibility with pytest-benchmark - """ - return codspeed_benchmark + +if not IS_PYTEST_BENCHMARK_INSTALLED: + benchmark = pytest.fixture(scope="function", name="benchmark")(_benchmark_compat) diff --git a/src/pytest_codspeed/utils.py b/src/pytest_codspeed/utils.py index 6c24143..95b9256 100644 --- a/src/pytest_codspeed/utils.py +++ b/src/pytest_codspeed/utils.py @@ -19,6 +19,8 @@ IS_PYTEST_BENCHMARK_INSTALLED = importlib.util.find_spec("pytest_benchmark") is not None IS_PYTEST_SPEED_INSTALLED = importlib.util.find_spec("pytest_speed") is not None BEFORE_PYTEST_8_1_1 = pytest.version_tuple < (8, 1, 1) +# Public API since pytest 9.1, required since 9.2 removed `_arg2fixturedefs` +HAS_PYTEST_REGISTER_FIXTURE = hasattr(pytest, "register_fixture") SUPPORTS_PERF_TRAMPOLINE = sysconfig.get_config_var("PY_HAVE_PERF_TRAMPOLINE") == 1 diff --git a/tests/conftest.py b/tests/conftest.py index e8a5625..c03d074 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -23,6 +23,11 @@ skip_with_pytest_benchmark = pytest.mark.skipif( IS_PYTEST_BENCHMARK_INSTALLED, reason="pytest_benchmark installed" ) +xfail_pytest_benchmark_on_pytest_9_2 = pytest.mark.xfail( + IS_PYTEST_BENCHMARK_INSTALLED and pytest.version_tuple >= (9, 2), + reason="pytest-benchmark is incompatible with pytest 9.2 (Node._nodeid removal)", + strict=False, +) if IS_PYTEST_BENCHMARK_INSTALLED: pytest_plugins.append("pytest_benchmark") print( diff --git a/tests/test_pytest_plugin.py b/tests/test_pytest_plugin.py index 452e9da..a266649 100644 --- a/tests/test_pytest_plugin.py +++ b/tests/test_pytest_plugin.py @@ -6,6 +6,7 @@ skip_with_perf_trampoline, skip_without_pytest_benchmark, skip_without_valgrind, + xfail_pytest_benchmark_on_pytest_9_2, ) @@ -119,6 +120,7 @@ def test_child(self): ) +@xfail_pytest_benchmark_on_pytest_9_2 def test_plugin_disabled(pytester: pytest.Pytester) -> None: pytester.copy_example("tests/examples/test_addition_fixture.py") result = pytester.runpytest() @@ -191,6 +193,7 @@ def test_another_useless_thing(): ) +@xfail_pytest_benchmark_on_pytest_9_2 @skip_without_pytest_benchmark def test_pytest_benchmark_compatibility(pytester: pytest.Pytester) -> None: pytester.makepyfile( From 3af46995392d2888148d8be506bc60d2bb22f2d9 Mon Sep 17 00:00:00 2001 From: Guillaume Lagrange Date: Wed, 28 Oct 2026 11:53:49 +0100 Subject: [PATCH 2/9] ci: test older pytest versions and run valgrind tests with pytest-benchmark The matrix only installed the latest pytest, so the fixture override paths for pytest without register_fixture (9.0) and before 8.1.1 were never exercised. Add pytest 9.0 and 8.0 jobs on Python 3.15 only, to avoid the full combinatorial matrix. The valgrind install condition matched a "pytest-benchmark" config that no longer exists since the split into -4 and -5, so the valgrind tests running --codspeed with pytest-benchmark installed were always skipped. Co-Authored-By: Claude --- .github/workflows/ci.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9f82262..9b0cee1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,6 +47,22 @@ jobs: - version: "3.15t" pytest-version: - ">=8.1.1" + # Older pytest versions only on the latest Python + include: + # Before pytest.register_fixture (private _arg2fixturedefs override) + - config: headless + python: { version: "3.15" } + pytest-version: "~=9.0.0" + - config: pytest-benchmark-5 + python: { version: "3.15" } + pytest-version: "~=9.0.0" + # Before 8.1.1 (getfixturedefs takes a nodeid) + - config: headless + python: { version: "3.15" } + pytest-version: "~=8.0.0" + - config: pytest-benchmark-4 + python: { version: "3.15" } + pytest-version: "~=8.0.0" steps: - uses: actions/checkout@v5 @@ -57,7 +73,7 @@ jobs: uses: actions/setup-python@v6 with: python-version: "${{ matrix.python.version }}" - - if: matrix.config == 'valgrind' || matrix.config == 'pytest-benchmark' + - if: matrix.config == 'valgrind' || startsWith(matrix.config, 'pytest-benchmark') name: Install valgrind run: | sudo apt-get update From 313214c61706d4c143f0174a24cf1be8298989a2 Mon Sep 17 00:00:00 2001 From: Guillaume Lagrange Date: Wed, 28 Oct 2026 14:15:56 +0100 Subject: [PATCH 3/9] ci: debug walltime shard 2 hang --- .github/workflows/codspeed.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codspeed.yml b/.github/workflows/codspeed.yml index 5cd4a2f..91eda71 100644 --- a/.github/workflows/codspeed.yml +++ b/.github/workflows/codspeed.yml @@ -18,11 +18,12 @@ jobs: benchmarks: strategy: matrix: - shard: [1, 2, 3, 4] - mode: ["simulation", "walltime", "memory"] + shard: [2] + mode: ["walltime"] name: "Run ${{ matrix.mode }} benchmarks (Shard #${{ matrix.shard }})" runs-on: ${{ matrix.mode == 'walltime' && 'codspeed-macro' || 'ubuntu-24.04' }} + timeout-minutes: 20 steps: - uses: actions/checkout@v5 with: @@ -39,9 +40,12 @@ jobs: sudo apt-get remove valgrind -y - name: Run benchmarks uses: CodSpeedHQ/action@main + env: + CODSPEED_LOG: debug + CODSPEED_SKIP_UPLOAD: "true" with: mode: ${{ matrix.mode }} - run: uv run pytest tests/benchmarks/ --codspeed --test-group=${{ matrix.shard }} --test-group-count=${{ env.SHARDS }} + run: uv run pytest tests/benchmarks/ --codspeed -v -o faulthandler_timeout=300 --test-group=${{ matrix.shard }} --test-group-count=${{ env.SHARDS }} all-checks: runs-on: ubuntu-latest From 22ac3db5e328a35fcc856d4be71d1d6df4f6335e Mon Sep 17 00:00:00 2001 From: Guillaume Lagrange Date: Wed, 28 Oct 2026 14:23:58 +0100 Subject: [PATCH 4/9] ci: repeat shard 2 --- .github/workflows/codspeed.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/codspeed.yml b/.github/workflows/codspeed.yml index 91eda71..b95fbbc 100644 --- a/.github/workflows/codspeed.yml +++ b/.github/workflows/codspeed.yml @@ -17,11 +17,13 @@ permissions: jobs: benchmarks: strategy: + fail-fast: false matrix: shard: [2] mode: ["walltime"] + attempt: [1, 2, 3, 4] - name: "Run ${{ matrix.mode }} benchmarks (Shard #${{ matrix.shard }})" + name: "Run ${{ matrix.mode }} benchmarks (Shard #${{ matrix.shard }}, attempt ${{ matrix.attempt }})" runs-on: ${{ matrix.mode == 'walltime' && 'codspeed-macro' || 'ubuntu-24.04' }} timeout-minutes: 20 steps: From d028c2d5caebff693ac3b35a49a01bac6af731a5 Mon Sep 17 00:00:00 2001 From: Guillaume Lagrange Date: Wed, 28 Oct 2026 14:46:28 +0100 Subject: [PATCH 5/9] ci: debug shard 2 as pull_request with upload --- .github/workflows/codspeed.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/codspeed.yml b/.github/workflows/codspeed.yml index b95fbbc..5b0a643 100644 --- a/.github/workflows/codspeed.yml +++ b/.github/workflows/codspeed.yml @@ -44,10 +44,9 @@ jobs: uses: CodSpeedHQ/action@main env: CODSPEED_LOG: debug - CODSPEED_SKIP_UPLOAD: "true" with: mode: ${{ matrix.mode }} - run: uv run pytest tests/benchmarks/ --codspeed -v -o faulthandler_timeout=300 --test-group=${{ matrix.shard }} --test-group-count=${{ env.SHARDS }} + run: uv run pytest tests/benchmarks/ --codspeed --test-group=${{ matrix.shard }} --test-group-count=${{ env.SHARDS }} all-checks: runs-on: ubuntu-latest From 7d703c7785e187854b6ecf32e90c0f5dbb2451c4 Mon Sep 17 00:00:00 2001 From: Guillaume Lagrange Date: Wed, 28 Oct 2026 15:10:34 +0100 Subject: [PATCH 6/9] ci: dump codspeed stacks when shard 2 hangs --- .github/workflows/codspeed.yml | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/.github/workflows/codspeed.yml b/.github/workflows/codspeed.yml index 5b0a643..700470e 100644 --- a/.github/workflows/codspeed.yml +++ b/.github/workflows/codspeed.yml @@ -21,7 +21,7 @@ jobs: matrix: shard: [2] mode: ["walltime"] - attempt: [1, 2, 3, 4] + attempt: [1, 2] name: "Run ${{ matrix.mode }} benchmarks (Shard #${{ matrix.shard }}, attempt ${{ matrix.attempt }})" runs-on: ${{ matrix.mode == 'walltime' && 'codspeed-macro' || 'ubuntu-24.04' }} @@ -40,6 +40,26 @@ jobs: sudo apt-get install valgrind -y uv sync --dev sudo apt-get remove valgrind -y + - name: Arm hang watcher + run: | + sudo apt-get install -y gdb >/dev/null + cat > /tmp/watch.sh <<'EOF' + sleep 480 + { + date -u + ps -ef --forest + systemd-cgls --no-pager -u codspeed.slice || true + for p in $(pgrep -x codspeed); do + echo "===== codspeed pid $p: $(tr '\0' ' ' < /proc/$p/cmdline)" + ps -L -o tid,pcpu,stat,wchan:32,comm -p "$p" + for t in /proc/$p/task/*; do echo "$t $(awk '{print $14, $15}' $t/stat)"; done + sleep 10 + for t in /proc/$p/task/*; do echo "$t $(awk '{print $14, $15}' $t/stat)"; done + sudo gdb -p "$p" -batch -ex "thread apply all bt 40" 2>&1 | grep -E "^(#|Thread)" + done + } > /tmp/hang-dump.txt 2>&1 + EOF + setsid nohup bash /tmp/watch.sh >/dev/null 2>&1 & - name: Run benchmarks uses: CodSpeedHQ/action@main env: @@ -47,6 +67,9 @@ jobs: with: mode: ${{ matrix.mode }} run: uv run pytest tests/benchmarks/ --codspeed --test-group=${{ matrix.shard }} --test-group-count=${{ env.SHARDS }} + - name: Print hang dump + if: always() + run: cat /tmp/hang-dump.txt || echo "no dump (no hang at 8 min)" all-checks: runs-on: ubuntu-latest From ed926cb1d85ce2bef7427f38c9941793ab7bc917 Mon Sep 17 00:00:00 2001 From: Guillaume Lagrange Date: Wed, 28 Oct 2026 15:49:11 +0100 Subject: [PATCH 7/9] ci: bisect walltime shard 2 hang --- .github/workflows/codspeed.yml | 50 ++++++++++++++-------------------- 1 file changed, 21 insertions(+), 29 deletions(-) diff --git a/.github/workflows/codspeed.yml b/.github/workflows/codspeed.yml index 700470e..f5ff4dd 100644 --- a/.github/workflows/codspeed.yml +++ b/.github/workflows/codspeed.yml @@ -21,15 +21,32 @@ jobs: matrix: shard: [2] mode: ["walltime"] - attempt: [1, 2] + variant: + - pr-code + - pr-code-skip-upload + - pr-code-verbose-faulthandler + - master-src + - master-plugin-py + - master-tests - name: "Run ${{ matrix.mode }} benchmarks (Shard #${{ matrix.shard }}, attempt ${{ matrix.attempt }})" + name: "Shard #${{ matrix.shard }} ${{ matrix.variant }}" runs-on: ${{ matrix.mode == 'walltime' && 'codspeed-macro' || 'ubuntu-24.04' }} - timeout-minutes: 20 + timeout-minutes: 14 steps: - uses: actions/checkout@v5 with: submodules: "recursive" + - name: Apply variant + run: | + git fetch -q --depth=1 origin master + case "${{ matrix.variant }}" in + master-src) git checkout FETCH_HEAD -- src/pytest_codspeed/plugin.py src/pytest_codspeed/utils.py ;; + master-plugin-py) git checkout FETCH_HEAD -- src/pytest_codspeed/plugin.py ;; + master-tests) git checkout FETCH_HEAD -- tests/conftest.py tests/test_pytest_plugin.py ;; + esac + git status --short + if [ "${{ matrix.variant }}" = pr-code-skip-upload ]; then echo "CODSPEED_SKIP_UPLOAD=true" >> "$GITHUB_ENV"; fi + if [ "${{ matrix.variant }}" = pr-code-verbose-faulthandler ]; then echo "EXTRA_ARGS=-v -o faulthandler_timeout=300" >> "$GITHUB_ENV"; fi - uses: astral-sh/setup-uv@v7 - uses: actions/setup-python@v6 with: @@ -40,36 +57,11 @@ jobs: sudo apt-get install valgrind -y uv sync --dev sudo apt-get remove valgrind -y - - name: Arm hang watcher - run: | - sudo apt-get install -y gdb >/dev/null - cat > /tmp/watch.sh <<'EOF' - sleep 480 - { - date -u - ps -ef --forest - systemd-cgls --no-pager -u codspeed.slice || true - for p in $(pgrep -x codspeed); do - echo "===== codspeed pid $p: $(tr '\0' ' ' < /proc/$p/cmdline)" - ps -L -o tid,pcpu,stat,wchan:32,comm -p "$p" - for t in /proc/$p/task/*; do echo "$t $(awk '{print $14, $15}' $t/stat)"; done - sleep 10 - for t in /proc/$p/task/*; do echo "$t $(awk '{print $14, $15}' $t/stat)"; done - sudo gdb -p "$p" -batch -ex "thread apply all bt 40" 2>&1 | grep -E "^(#|Thread)" - done - } > /tmp/hang-dump.txt 2>&1 - EOF - setsid nohup bash /tmp/watch.sh >/dev/null 2>&1 & - name: Run benchmarks uses: CodSpeedHQ/action@main - env: - CODSPEED_LOG: debug with: mode: ${{ matrix.mode }} - run: uv run pytest tests/benchmarks/ --codspeed --test-group=${{ matrix.shard }} --test-group-count=${{ env.SHARDS }} - - name: Print hang dump - if: always() - run: cat /tmp/hang-dump.txt || echo "no dump (no hang at 8 min)" + run: uv run pytest tests/benchmarks/ --codspeed ${{ env.EXTRA_ARGS }} --test-group=${{ matrix.shard }} --test-group-count=${{ env.SHARDS }} all-checks: runs-on: ubuntu-latest From c4c257db50fd9ef170f60058a38b4e605449c123 Mon Sep 17 00:00:00 2001 From: Guillaume Lagrange Date: Wed, 28 Oct 2026 16:17:45 +0100 Subject: [PATCH 8/9] ci: probe samply drain in hanging vs passing variant --- .github/workflows/codspeed.yml | 47 ++++++++++++++++++++++++---------- 1 file changed, 34 insertions(+), 13 deletions(-) diff --git a/.github/workflows/codspeed.yml b/.github/workflows/codspeed.yml index f5ff4dd..18c4322 100644 --- a/.github/workflows/codspeed.yml +++ b/.github/workflows/codspeed.yml @@ -23,15 +23,11 @@ jobs: mode: ["walltime"] variant: - pr-code - - pr-code-skip-upload - - pr-code-verbose-faulthandler - master-src - - master-plugin-py - - master-tests name: "Shard #${{ matrix.shard }} ${{ matrix.variant }}" runs-on: ${{ matrix.mode == 'walltime' && 'codspeed-macro' || 'ubuntu-24.04' }} - timeout-minutes: 14 + timeout-minutes: 12 steps: - uses: actions/checkout@v5 with: @@ -39,14 +35,10 @@ jobs: - name: Apply variant run: | git fetch -q --depth=1 origin master - case "${{ matrix.variant }}" in - master-src) git checkout FETCH_HEAD -- src/pytest_codspeed/plugin.py src/pytest_codspeed/utils.py ;; - master-plugin-py) git checkout FETCH_HEAD -- src/pytest_codspeed/plugin.py ;; - master-tests) git checkout FETCH_HEAD -- tests/conftest.py tests/test_pytest_plugin.py ;; - esac + if [ "${{ matrix.variant }}" = master-src ]; then + git checkout FETCH_HEAD -- src/pytest_codspeed/plugin.py src/pytest_codspeed/utils.py + fi git status --short - if [ "${{ matrix.variant }}" = pr-code-skip-upload ]; then echo "CODSPEED_SKIP_UPLOAD=true" >> "$GITHUB_ENV"; fi - if [ "${{ matrix.variant }}" = pr-code-verbose-faulthandler ]; then echo "EXTRA_ARGS=-v -o faulthandler_timeout=300" >> "$GITHUB_ENV"; fi - uses: astral-sh/setup-uv@v7 - uses: actions/setup-python@v6 with: @@ -57,11 +49,40 @@ jobs: sudo apt-get install valgrind -y uv sync --dev sudo apt-get remove valgrind -y + - name: Arm drain probe + run: | + sudo apt-get install -y strace >/dev/null + cat > /tmp/probe.sh <<'EOF' + until pgrep -f "pytest tests/benchmarks" >/dev/null; do sleep 0.5; done + while pgrep -f "pytest tests/benchmarks" >/dev/null; do sleep 0.2; done + p=$(pgrep -f "codspeed samply record" | head -n1) + { + echo "pytest exited at $(date -u +%T.%N), samply pid $p" + [ -n "$p" ] || exit 0 + echo "fds: $(sudo ls /proc/$p/fd | wc -l), perf fds: $(sudo ls -l /proc/$p/fd | grep -c perf_event)" + t=$(ps -L -o tid=,pcpu= -p "$p" | sort -k2 -nr | head -n1 | awk '{print $1}') + echo "busiest tid $t" + for i in $(seq 20); do + echo "-- $(date -u +%T.%N) syscall: $(sudo cat /proc/$p/task/$t/syscall 2>&1)" + sudo cat /proc/$p/task/$t/stack 2>&1 | head -n 8 + sleep 0.2 + done + echo "== strace -c 10s" + sudo timeout -s INT 10 strace -f -c -p "$p" 2>&1 | head -n 30 + echo "== raw strace 3s on tid $t" + sudo timeout -s INT 3 strace -tt -p "$t" 2>&1 | head -n 200 + echo "== still alive at $(date -u +%T.%N)? $(pgrep -f 'codspeed samply record' || echo no)" + } > /tmp/drain-probe.txt 2>&1 + EOF + setsid nohup bash /tmp/probe.sh >/dev/null 2>&1 & - name: Run benchmarks uses: CodSpeedHQ/action@main with: mode: ${{ matrix.mode }} - run: uv run pytest tests/benchmarks/ --codspeed ${{ env.EXTRA_ARGS }} --test-group=${{ matrix.shard }} --test-group-count=${{ env.SHARDS }} + run: uv run pytest tests/benchmarks/ --codspeed --test-group=${{ matrix.shard }} --test-group-count=${{ env.SHARDS }} + - name: Print drain probe + if: always() + run: cat /tmp/drain-probe.txt || echo "no probe output" all-checks: runs-on: ubuntu-latest From 81524c3f45562ca7c34765eb2e61578de5a70f83 Mon Sep 17 00:00:00 2001 From: Guillaume Lagrange Date: Wed, 28 Oct 2026 16:18:56 +0100 Subject: [PATCH 9/9] ci: shard 2 with and without multiprocessing benchmark --- .github/workflows/codspeed.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/codspeed.yml b/.github/workflows/codspeed.yml index 18c4322..bfad00f 100644 --- a/.github/workflows/codspeed.yml +++ b/.github/workflows/codspeed.yml @@ -21,9 +21,12 @@ jobs: matrix: shard: [2] mode: ["walltime"] - variant: - - pr-code - - master-src + variant: [pr-code-no-mp, pr-code-only-mp] + include: + - variant: pr-code-no-mp + kexpr: "not test_multiprocessing_map" + - variant: pr-code-only-mp + kexpr: "test_multiprocessing_map" name: "Shard #${{ matrix.shard }} ${{ matrix.variant }}" runs-on: ${{ matrix.mode == 'walltime' && 'codspeed-macro' || 'ubuntu-24.04' }} @@ -79,7 +82,7 @@ jobs: uses: CodSpeedHQ/action@main with: mode: ${{ matrix.mode }} - run: uv run pytest tests/benchmarks/ --codspeed --test-group=${{ matrix.shard }} --test-group-count=${{ env.SHARDS }} + run: uv run pytest tests/benchmarks/ --codspeed --test-group=${{ matrix.shard }} --test-group-count=${{ env.SHARDS }} -k "${{ matrix.kexpr }}" - name: Print drain probe if: always() run: cat /tmp/drain-probe.txt || echo "no probe output"