From fdde52847176e8c9485fc623b7cc5bdc41453464 Mon Sep 17 00:00:00 2001 From: Benjamin Simon Date: Wed, 14 Oct 2026 19:22:00 +0200 Subject: [PATCH] run coverage only on python 3.14 in CI Before 3.14, coverage traces with sys.settrace, which slows the tests down several times and makes the timing-sensitive websocket tests flaky. 3.14+ uses sys.monitoring (PEP 669), so the other versions run the tests without coverage. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/build.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f33faba..9a78c00 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,6 +22,7 @@ jobs: python-version: [ "3.10", "3.11", "3.12", "3.13", "3.14", "3.15" ] env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + COVERAGE_PYTHON_VERSION: "3.14" steps: - name: Checkout uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -40,11 +41,20 @@ jobs: run: | make lint + # coverage only runs on one version: before 3.14 it traces with sys.settrace, which slows the tests down + # several times and makes the timing-sensitive tests flaky. 3.14+ uses sys.monitoring (PEP 669). - name: Run tests + if: matrix.python-version != env.COVERAGE_PYTHON_VERSION + run: | + make test + + - name: Run tests with coverage + if: matrix.python-version == env.COVERAGE_PYTHON_VERSION run: | make test-coverage - name: Report coverage + if: matrix.python-version == env.COVERAGE_PYTHON_VERSION run: | make coveralls