Skip to content

run coverage only on python 3.14 in CI - #63

Merged
bentsku merged 1 commit into
mainfrom
ci-coverage-single-version
Oct 14, 2026
Merged

bentsku merged 1 commit into
mainfrom
ci-coverage-single-version

Conversation

@bentsku

@bentsku bentsku commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator

Motivation

On Python 3.10–3.13, coverage (7.16) measures with its C tracer through sys.settrace, which runs a callback for every line in every frame, including the test client, Twisted and websocket-client code it doesn't report on. Since 3.14, coverage uses sys.monitoring (PEP 669) by default and disables events for code it has already seen, so its overhead is close to zero.

This shows in CI: tests/websocket/test_websockets.py takes 23–30 s on 3.14/3.15, but 42–127 s on 3.10–3.13. The websocket tests run the client and the server in one process and depend on timing, for example the server's 5 s close timeout, so the slowdown made them flaky. In a recent failure, test_server_close_while_client_is_sending failed on 3.11 in a run where that file took 127 s.

Changes

  • Only the 3.14 job (COVERAGE_PYTHON_VERSION) runs make test-coverage and reports to Coveralls.
  • The other versions run make test, which collects the same 212 tests.

🤖 Generated with Claude Code

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 <noreply@anthropic.com>
@bentsku
bentsku merged commit 6b4e146 into main Oct 14, 2026
7 checks passed
@bentsku
bentsku deleted the ci-coverage-single-version branch October 14, 2026 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant