From 9fda51ec6be779e1bd8f439561dc9dbb9d3a94b2 Mon Sep 17 00:00:00 2001 From: Xubin Ren <52506698+Re-bin@users.noreply.github.com> Date: Wed, 16 Sep 2026 01:23:11 +0800 Subject: [PATCH] test(websocket): isolate all outbound delivery checks from disk --- .../websocket/tests/test_websocket_outbound_delivery.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/nanobot/channels/websocket/tests/test_websocket_outbound_delivery.py b/nanobot/channels/websocket/tests/test_websocket_outbound_delivery.py index 61d9de94d..9f9b81e42 100644 --- a/nanobot/channels/websocket/tests/test_websocket_outbound_delivery.py +++ b/nanobot/channels/websocket/tests/test_websocket_outbound_delivery.py @@ -81,7 +81,10 @@ def _channel() -> WebSocketChannel: runtime_surface="tui", runtime_capabilities_overrides=None, ) - return WebSocketChannel(config, bus, gateway=gateway) + channel = WebSocketChannel(config, bus, gateway=gateway) + # Keep disk latency out of every connection delivery synchronization check. + channel._persist_turn_transcript_event = MagicMock(return_value=True) + return channel def _message(chat_id: str, text: str) -> OutboundMessage: @@ -109,8 +112,6 @@ async def _wait_for_retire_tasks(channel: WebSocketChannel) -> None: @pytest.mark.asyncio async def test_message_bus_delivers_to_ten_tuis_with_one_blocked_connection() -> None: channel = _channel() - # Keep disk latency out of the connection delivery synchronization check. - channel._persist_turn_transcript_event = MagicMock(return_value=True) bus = MessageBus() config = Config.model_validate({"channels": {"websocket": {"enabled": False}}}) manager = ChannelManager(config, bus)