From 4cd4b3e8a22f0d323d662658212f8c8f42272058 Mon Sep 17 00:00:00 2001 From: Brooklyn Nicholson Date: Fri, 24 Jul 2026 10:45:33 -0500 Subject: [PATCH] test(gateway): account for the auto-archive construction-time sync escape The gateway startup maintenance block gained a maybe_auto_archive call in the same provably-off-loop __init__ site as maybe_auto_prune_and_vacuum; bump the reviewed sync-escape count from 3 to 4. --- tests/gateway/test_async_session_db.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/gateway/test_async_session_db.py b/tests/gateway/test_async_session_db.py index c09b5485ae7c..8799bb0a8937 100644 --- a/tests/gateway/test_async_session_db.py +++ b/tests/gateway/test_async_session_db.py @@ -125,8 +125,10 @@ _GATEWAY_FILES = ("gateway/run.py", "gateway/slash_commands.py") # - self._session_db._db.: the sync escape, allowed ONLY where the call is # provably off the event loop — construction (__init__, before the loop # serves) and the run_sync closure (executed in a thread-pool executor). -# Three such sites today; a fourth must be justified and this count bumped. -_ALLOWED_SYNC_DB_ESCAPES = 3 +# Four such sites today (maybe_auto_archive joined maybe_auto_prune_and_vacuum +# in the construction-time maintenance block); a fifth must be justified and +# this count bumped. +_ALLOWED_SYNC_DB_ESCAPES = 4 # Sync helpers that touch SessionDB but are NEVER invoked bare on the loop: # every loop-side call wraps them in ``asyncio.to_thread(...)`` and the only