Skip to content

Commit f8072c9

Browse files
committed
Add type annotations to race condition test functions
1 parent 2955d84 commit f8072c9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/issues/test_1363_race_condition_streamable_http.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
SERVER_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

Comments
 (0)