File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments