3636SERVER_NAME = "test_race_condition_server"
3737
3838
39- def check_server_logs_for_errors (process , test_name : str ):
39+ def check_server_logs_for_errors (process : subprocess . Popen [ str ] , test_name : str ) -> None :
4040 """
4141 Check server logs for ClosedResourceError and other race condition errors.
4242
@@ -52,7 +52,7 @@ def check_server_logs_for_errors(process, test_name: str):
5252 server_logs = ""
5353
5454 # Check for specific race condition errors
55- errors_found = []
55+ errors_found : list [ str ] = []
5656
5757 if "ClosedResourceError" in server_logs :
5858 errors_found .append ("ClosedResourceError" )
@@ -93,7 +93,7 @@ async def on_list_tools(self) -> list[Tool]:
9393 return []
9494
9595
96- def run_server_with_logging (port : int ):
96+ def run_server_with_logging (port : int ) -> None :
9797 """Run the StreamableHTTP server with logging to capture race condition errors."""
9898 app = RaceConditionTestServer ()
9999
@@ -122,7 +122,7 @@ async def lifespan(app: Starlette) -> AsyncGenerator[None, None]:
122122 uvicorn .run (starlette_app , host = "127.0.0.1" , port = port , log_level = "debug" )
123123
124124
125- def start_server_process (port : int ):
125+ def start_server_process (port : int ) -> subprocess . Popen [ str ] :
126126 """Start server in a separate process."""
127127 # Create a temporary script to run the server
128128 import os
0 commit comments