Skip to content

The agent that grows with you

test(gateway): the Bot Chat owner-loop test times the held writer, not first plugin load

Teknium0b0f7f15f13b
diff --git a/tests/gateway/test_owner_loop_writes_bot_chat_create.py b/tests/gateway/test_owner_loop_writes_bot_chat_create.py
index 4fc76475f71..54de6052ee7 100644
--- a/tests/gateway/test_owner_loop_writes_bot_chat_create.py
+++ b/tests/gateway/test_owner_loop_writes_bot_chat_create.py
@@ -21,6 +21,11 @@ async def _resolve(bot):
@pytest.mark.asyncio
async def test_bot_chat_creation_commits_off_the_owner_loop(bot):
db = bot.authority.db
+ # A serving owner discovered plugins at startup (_start_register_plugins_relay_hooks); this
+ # bare fixture has not, so the first policy build would load every plugin ON the loop and
+ # the ticker would time plugin import instead of the held writer.
+ from hermes_cli.plugins import discover_plugins
+ await asyncio.to_thread(discover_plugins)
held, release = threading.Event(), threading.Event()
def hold_writer(): # another process's writer