ci: Sprint 0 — coverage-testability + release 0.13.12#71
Merged
Conversation
Sprint 0 (coverage). Coverage is now reported correctly via pytest-cov + xdist, but a handful of TestCircuitBreaker tests use bare time.sleep(1.1) to wait out the 1.0s recovery_timeout. That was a 3.3-second tax per worker on every xdist run, and the suite could not be collected on Windows in a reasonable time without the cap. The conftest autouse fixture _fast_sleep caps test sleeps at 1ms, which is well above the cancellable-wait regression threshold (0.05s) and zero impact on retries (the existing per-test monkeypatch covers the time.monotonic path). Three TestCircuitBreaker tests now advance the wall clock via _advance_clock(monkeypatch) instead of sleeping, so the recovery transition fires deterministically. Opt-out: @pytest.mark.slow_sleep on a test class keeps the real wall clock (e.g. test_ping_chain_emits_heartbeats_on_time_schedule needs real-time progression for the scheduler thread). Verified: 1237 passed, 7 skipped, 29 warnings in 34.92s; combined coverage 80.98% (vs 79.26% on master 29caae9).
Bump SDK 0.13.11 -> 0.13.12. CI scope only — no on-wire change, no SDK_MIN_VERSION bump, no public API change. Backends on 1.0.0 keep working unchanged. Pyproject version + __version__ + CHANGELOG entry. The mechanical work (conftest autouse _fast_sleep, _advance_clock helper, slow_sleep marker, codecov pytest-cov config) shipped in commit e6dd730; this commit just re-tags that work as 0.13.12 so the published wheel exposes the new version string. Verified: 1237 passed, 7 skipped, 29 warnings; combined coverage 80.87% (vs master 29caae9 79.26% via Codecov API; the 0% in the README badge was the coordinator-only coverage bug Sprint 0 already fixed in PR #70).
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
time.sleep(1.1)tax inTestCircuitBreakerhalf-open tests. Newtests/conftest.pyautouse fixture_fast_sleepcaps test-codetime.sleepat 1ms with two opt-out paths (@pytest.mark.slow_sleepmarker on a test/class,NULLRUN_FAST_SLEEP=0env var). ThreeTestCircuitBreakertests now use a_advance_clock(monkeypatch, seconds=...)helper that patchestime.monotonicinstead of sleeping.pyproject.tomlversion and__version__.pydocstring, adds CHANGELOG entry. CI scope only — no on-wire change, no SDK_MIN_VERSION bump, no public API change. Backends on 1.0.0 keep working unchanged.Root cause
The pre-Sprint-0 CI uploaded a coordinator-only 0% coverage report (because
coverage run -m pytest -n autoonly ran coverage in the pytest coordinator, not in the xdist workers). That put the Codecov badge at 0% in the README and dragged combined coverage below the 80% floor in.codecov.yml. The half-open CB tests'time.sleep(1.1)added a 3.3s wall-clock tax per worker on every xdist run, which on Windows' single-worker-bound xdist made the suite borderline-hang.Why this PR splits Sprint 0 + the version bump
e6dd730(Sprint 0): the mechanical work — conftest, helper, marker, codecov pytest-cov config. Tagged as a commit, not a release, because version bumps require a CHANGELOG + pyproject bump and a release commit.9a11558(this commit, 0.13.12): just the version strings. The wheel will now expose 0.13.12 with the Sprint 0 work inside it.Verification
ruff check src/— All checks passedmypy src/— Success: no issues found in 34 source filespytest -n auto --cov=src/nullrun --cov-branch --cov-report=xml:coverage.xml --cov-report=term --cov-fail-under=0— 1237 passed, 7 skipped, 29 warnings, 33.99s, combined coverage 80.87% (master 29caae9 was 79.26% via Codecov API)Test plan
ruff check src/mypy src/tests/test_transport.py,tests/test_transport_branches.py, etc. underpytest -n autoon all three matrix Python versions (3.10, 3.11, 3.12). Expect all green.Out of scope (tracked separately)
test_status.py::TestRecentErrorsandTestTransport::test_stop_flush_false_skips_final_flush(~1/3 of local runs, passes in isolation and inpytest -n 0/-n 2). Sprint 0 did not introduce and did not fix it.# pragma: no covercleanup) will land on top of 0.13.12.Closes the SDK-side item on the coverage-readiness audit.