Commit a41ef89
committed
fix(coverage): lax no cover on two matrix-entry-dependent except handlers
Two `except Exception:` handlers fire on some CI matrix entries but not
others — not random, but deterministic per {python, deps, os} combo:
streamable_http.py:638 — POST handler's outer except. Fires on
3.12 lowest-direct ubuntu (older dep versions, different shutdown
exception propagation), not on the other 19 entries.
streamable_http.py:721 — standalone SSE writer's except. Fires on
19/20 entries, not on 3.14 locked ubuntu (EventSourceResponse task
cancellation wins the race there; the closed-stream error wins
elsewhere).
Both are concurrent-shutdown handlers. The underlying race is
production behavior (client disconnect while server is writing), but
whether tests observe it depends on the interpreter's task scheduling
and the httpx/sse-starlette versions in play. Previously invisible —
subprocess-based tests ran this code in a separate process that
coverage.py couldn't see.
This is the intended use of lax no cover: coverage that differs across
the matrix for reasons outside the test's control.1 parent 50a2183 commit a41ef89
1 file changed
+6
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
633 | 633 | | |
634 | 634 | | |
635 | 635 | | |
636 | | - | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
637 | 639 | | |
638 | 640 | | |
639 | 641 | | |
| |||
714 | 716 | | |
715 | 717 | | |
716 | 718 | | |
717 | | - | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
718 | 722 | | |
719 | 723 | | |
720 | 724 | | |
| |||
0 commit comments