Kevin

Daemon Test Harness — collection, gates and process-wide state

pytest.ini testpaths feed one process: every conftest is imported at COLLECTION, before any test runs, so anything one of them mutates globally (the asyncio event loop policy) belongs to the whole session. The two ratchets — tier markers and event loop policy — plus where CI selects by marker.

Daemon Test Harness — collection, gates and process-wide state (v2026-08-28T202227Z-905c329c98) 2026-08-29 | pytest.ini testpaths feed one process: every conftest is imported at COLLECTION, before any test runs, so anything one of them mutates globally (the asyncio event loop policy) belongs to the whole session. The two ratchets — tier markers and event loop policy — plus where CI selects by marker. 1 - COLLECTION - pytest collects tests pytest pytest.ini testpaths COLLECTION conftest.py 2 - GATES - markers and event loop policy daemon/conftest.py unmarked_test_files event_loop_policy_offenders pytest_asyncio_loop_factories cleanup_database 3 - PROCESS-WIDE STATE - session state management KEVIN_HOME make_session_home sweep_abandoned_test_homes graphify-out/*.json logs/*.jsonl event_bus_lvc.db EventBus db/event_bus_lvc.db sqlite call GIL contention session home c… 1. pytest collects tests 2. apply markers and event loop policy 3. manage session-wide state pytest.ini configuration [pytest] pythonpath = src .. ../tools ../tools/noted testpaths = src/hank/tests src/license_server/tests src/plugins/sterling/tests tests metaindex fabric_proxy/tests ../plu… asyncio_mode = auto addopts = --import-mode=importlib filterwarnings = ignore::DeprecationWarning event_loop_policy_offenders detection def event_loop_policy_offenders(paths): offenders = [] for path in paths: with open(path, 'r') as f: tree = ast.parse(f.read()) for node in ast.walk(tree): if isinstance(node, ast.Call) and isinstance(node.func, ast.Attribute) and node.func.attr == 'set_event_… offenders.append((path, 'module scope')) return offenders The event loop policy is set in `daemon/src/license_server/tests/conftest.py`, which affects all tests collected after it in the same session. Legend actor = initiates work · process = code path · store = state on disk · bus = durable queue · dashed = separate process cyan = request flow · pink = state read/write · dashed green = pull / return path · red = refusal As of 2026-08-29 22:55 UTC, from commit 619e0ed

Provenance

This drawing is generated, not drawn. It is rebuilt from the source files below, so when they change the picture changes — a diagram here cannot quietly describe a system that no longer works this way.

Owner
Kevin
Slug
daemon-test-harness
Rendered
2026-08-28T202227Z
From commit
905c329c98
Updated
29 Aug 2026, 22:55 UTC
Sources at
619e0ed
Watches
13 paths
  • daemon/conftest.py
  • daemon/pytest.ini
  • daemon/tests/test_marker_guard.py
  • daemon/tests/test_event_loop_policy_guard.py
  • daemon/src/license_server/tests/conftest.py
  • daemon/scripts/coverage_gate.py
  • daemon/config/coverage-gates.yaml
  • daemon/scripts/coverage_entry_check.py
  • kevin_subprocess.py
  • daemon/src/proc_text.py
  • daemon/tests/test_child_encoding_guard.py
  • daemon/tests/test_kevin_subprocess.py
  • .gitea/workflows/daemon-gates.yml