From 382f1b12e8d9b2d4dbe2d2803e5f5b9a6e262972 Mon Sep 17 00:00:00 2001 From: Xubin Ren <52506698+Re-bin@users.noreply.github.com> Date: Thu, 5 Nov 2026 11:10:42 +0800 Subject: [PATCH] test(agent): allow storage shutdown to finish during cleanup --- tests/agent/test_subagent_control.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/agent/test_subagent_control.py b/tests/agent/test_subagent_control.py index e22224225..53052f7a4 100644 --- a/tests/agent/test_subagent_control.py +++ b/tests/agent/test_subagent_control.py @@ -150,9 +150,12 @@ async def test_sdk_ephemeral_delegation_never_persists_on_later_flush( assert [row["key"] for row in loop.sessions.list_sessions()] == [key] finally: loop.stop() - await asyncio.wait_for(consumer, timeout=2) - logger.remove(sink) - await bot.aclose() + try: + # Bound cleanup without imposing a two-second disk/thread shutdown contract. + await asyncio.wait_for(consumer, timeout=30) + finally: + logger.remove(sink) + await bot.aclose() @pytest.mark.asyncio