perf(backend): tests skip the event bus's sync_events write (5 s lock wait per broadcast)
services.ws_bus persists every broadcast through its own connection, which waited on the test transaction until SQLite's 5 s busy timeout and then failed quietly. An autouse fixture stubs _persist_event; no test uses the replay buffer. Full suite 61 s -> 17 s. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -67,6 +67,16 @@ def pytest_collection_modifyitems(config, items):
|
||||
|
||||
# ── venue time ──────────────────────────────────────────────────────────────
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def _no_event_persistence(monkeypatch):
|
||||
"""services.ws_bus writes every broadcast to sync_events through its OWN connection,
|
||||
which waits on the test's open transaction until SQLite's 5 s lock timeout (and then
|
||||
fails quietly). Tests don't use the replay buffer, so the write is skipped here.
|
||||
Tests about events capture services.sse_bus.broadcast_sync instead."""
|
||||
import services.ws_bus as ws_bus
|
||||
monkeypatch.setattr(ws_bus, "_persist_event", lambda *a, **k: 0)
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def _venue_time():
|
||||
"""Every test runs in Europe/Athens with rollover 06:00 (D-11), venue language "en"
|
||||
|
||||
Reference in New Issue
Block a user