Skip to content

Commit bb5f988

Browse files
Improve test docstring to clarify asyncio task-safety vs thread-safety
Co-authored-by: MarcSkovMadsen <42288570+MarcSkovMadsen@users.noreply.github.com>
1 parent 18b0d20 commit bb5f988

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

tests/test_client.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,13 @@ class TestClientSingleton:
1919
async def test_concurrent_client_initialization(self):
2020
"""Test that concurrent calls to call_tool don't create multiple clients.
2121
22-
This test verifies that the singleton client pattern is thread-safe
23-
and handles race conditions properly when multiple tasks call call_tool
24-
concurrently before the client is initialized.
22+
This test verifies that the singleton client pattern handles race
23+
conditions properly when multiple async tasks call call_tool
24+
concurrently before the client is initialized. The asyncio.Lock
25+
ensures only one task initializes the client.
2526
"""
26-
# Reset the client state by importing fresh
27+
# Reset the client state for testing
28+
# Note: This directly manipulates module state for testing purposes
2729
import holoviz_mcp.client as client_module
2830

2931
client_module._CLIENT = None

0 commit comments

Comments
 (0)