Skip to content

Commit d749ee9

Browse files
committed
fix: remove coverage context table to fix xdist worker crash
- Remove --cov-context=test from CI pytest command - Remove context = test from pyproject.toml [tool.coverage.run] - Fix signed_approval.py conditional import for mypy pre-commit The SQLite 'context' table created by coverage's per-test context feature races under xdist parallel workers, producing: sqlite3.OperationalError: no such table: context This kills the xdist worker, cascading into 800+ test errors. Constraint: coverage --cov-context=test is incompatible with xdist -n auto Tested: ruff, bandit, mypy (source+tests), audit_test_quality, audit_config_access, smoke test tier Confidence: high
1 parent 06809d8 commit d749ee9

3 files changed

Lines changed: 5 additions & 7 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ jobs:
138138
env:
139139
PYTHONHASHSEED: "0"
140140
# Use xdist -n auto to parallelize and avoid OOM on GH runners
141-
run: pytest --random-order -n auto --dist worksteal --cov=teaagent --cov-context=test --cov-report=term-missing --cov-fail-under=75
141+
run: pytest --random-order -n auto --dist worksteal --cov=teaagent --cov-report=term-missing --cov-fail-under=75
142142

143143
test-telemetry:
144144
runs-on: ubuntu-latest

pyproject.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,6 @@ targets = ["."]
236236

237237
[tool.coverage.run]
238238
source = ["teaagent"]
239-
# Per-test context reduces memory pressure from coverage tracking
240-
# across 5000+ tests under pydantic-core instrumentation.
241-
context = "test"
242239
omit = [
243240
"teaagent/tui/*",
244241
"teaagent/tournament/*",

teaagent/coordination/signed_approval.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,17 @@
55
import base64
66
import json
77
from dataclasses import dataclass
8-
from typing import Any
8+
from typing import TYPE_CHECKING, Any
99

1010
try:
1111
from cryptography.hazmat.primitives.asymmetric.ed25519 import (
1212
Ed25519PrivateKey,
1313
Ed25519PublicKey,
1414
)
1515
except ImportError: # pragma: no cover - optional dependency path
16-
Ed25519PrivateKey = None # type: ignore[misc, assignment]
17-
Ed25519PublicKey = None # type: ignore[misc, assignment]
16+
if not TYPE_CHECKING:
17+
Ed25519PrivateKey = None
18+
Ed25519PublicKey = None
1819

1920

2021
@dataclass(frozen=True)

0 commit comments

Comments
 (0)