Skip to content

armgit / sie

Public Imported from GitHub
0

Open-source inference server and production cluster for all the models your agent needs.

test(server): keep WebSocket status polling paced (#764)

Krisztian Gajdarf494e702a7b8
diff --git a/packages/sie_server/tests/api/test_ws.py b/packages/sie_server/tests/api/test_ws.py
index bb3194e4e..687b27a44 100644
--- a/packages/sie_server/tests/api/test_ws.py
+++ b/packages/sie_server/tests/api/test_ws.py
@@ -4,7 +4,6 @@ import tempfile
from collections.abc import Generator
from importlib.metadata import version
from pathlib import Path
-from unittest.mock import AsyncMock, patch
import pytest
from fastapi.testclient import TestClient
@@ -195,9 +194,10 @@ class TestWebSocketEndpoint:
assert server["working_dir"] == ""
assert server["pid"] == 0
- @patch("sie_server.api.ws.asyncio.sleep", new_callable=AsyncMock)
- def test_websocket_sends_multiple_updates(self, mock_sleep: AsyncMock, client: TestClient) -> None:
+ def test_websocket_sends_multiple_updates(self, client: TestClient) -> None:
"""WebSocket sends multiple status updates."""
+ # Keep the real interval: a no-op sleep floods the client's unbounded
+ # message queue and retains every call in the mock, risking CI OOMs.
with client.websocket_connect("/ws/status") as websocket:
# Receive two messages
data1 = websocket.receive_json()
@@ -209,7 +209,6 @@ class TestWebSocketEndpoint:
# Second timestamp should be >= first
assert data2["timestamp"] >= data1["timestamp"]
- mock_sleep.assert_called()
def test_websocket_gpus_is_list(self, client: TestClient) -> None:
"""GPUs field is always a list."""