Skip to content

Commit 6e6f902

Browse files
authored
Merge branch 'main' into main
2 parents 0c20403 + 0b1b52b commit 6e6f902

File tree

2 files changed

+28
-14
lines changed

2 files changed

+28
-14
lines changed

.github/CODEOWNERS

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# CODEOWNERS for MCP Python SDK
2+
# See https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
3+
4+
# Default maintainers for everything
5+
* @modelcontextprotocol/python-sdk-maintainers
6+
7+
# Auth-related code requires additional review from auth team
8+
/src/mcp/client/auth.py @modelcontextprotocol/python-sdk-auth @modelcontextprotocol/python-sdk-maintainers
9+
/src/mcp/server/auth/ @modelcontextprotocol/python-sdk-auth @modelcontextprotocol/python-sdk-maintainers
10+
/src/mcp/server/transport_security.py @modelcontextprotocol/python-sdk-auth @modelcontextprotocol/python-sdk-maintainers
11+
/src/mcp/shared/auth*.py @modelcontextprotocol/python-sdk-auth @modelcontextprotocol/python-sdk-maintainers
12+
13+
# Auth-related tests
14+
/tests/client/test_auth.py @modelcontextprotocol/python-sdk-auth @modelcontextprotocol/python-sdk-maintainers
15+
/tests/server/auth/ @modelcontextprotocol/python-sdk-auth @modelcontextprotocol/python-sdk-maintainers
16+
/tests/server/test_*security.py @modelcontextprotocol/python-sdk-auth @modelcontextprotocol/python-sdk-maintainers
17+
/tests/server/fastmcp/auth/ @modelcontextprotocol/python-sdk-auth @modelcontextprotocol/python-sdk-maintainers
18+
/tests/shared/test_auth*.py @modelcontextprotocol/python-sdk-auth @modelcontextprotocol/python-sdk-maintainers
19+
20+
# Auth-related examples
21+
/examples/clients/simple-auth-client/ @modelcontextprotocol/python-sdk-auth @modelcontextprotocol/python-sdk-maintainers
22+
/examples/snippets/clients/oauth_client.py @modelcontextprotocol/python-sdk-auth @modelcontextprotocol/python-sdk-maintainers
23+
/examples/snippets/servers/oauth_server.py @modelcontextprotocol/python-sdk-auth @modelcontextprotocol/python-sdk-maintainers

tests/issues/test_88_random_error.py

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ async def test_notification_validation_error(tmp_path: Path):
2828

2929
server = Server(name="test")
3030
request_count = 0
31-
slow_request_started = anyio.Event()
32-
slow_request_complete = anyio.Event()
31+
slow_request_lock = anyio.Event()
3332

3433
@server.list_tools()
3534
async def list_tools() -> list[types.Tool]:
@@ -52,16 +51,9 @@ async def slow_tool(name: str, arg) -> Sequence[ContentBlock]:
5251
request_count += 1
5352

5453
if name == "slow":
55-
# Signal that slow request has started
56-
slow_request_started.set()
57-
# Long enough to ensure timeout
58-
await anyio.sleep(0.2)
59-
# Signal completion
60-
slow_request_complete.set()
54+
await slow_request_lock.wait() # it should timeout here
6155
return [TextContent(type="text", text=f"slow {request_count}")]
6256
elif name == "fast":
63-
# Fast enough to complete before timeout
64-
await anyio.sleep(0.01)
6557
return [TextContent(type="text", text=f"fast {request_count}")]
6658
return [TextContent(type="text", text=f"unknown {request_count}")]
6759

@@ -90,16 +82,15 @@ async def client(read_stream, write_stream, scope):
9082
# First call should work (fast operation)
9183
result = await session.call_tool("fast")
9284
assert result.content == [TextContent(type="text", text="fast 1")]
93-
assert not slow_request_complete.is_set()
85+
assert not slow_request_lock.is_set()
9486

9587
# Second call should timeout (slow operation)
9688
with pytest.raises(McpError) as exc_info:
9789
await session.call_tool("slow")
9890
assert "Timed out while waiting" in str(exc_info.value)
9991

100-
# Wait for slow request to complete in the background
101-
with anyio.fail_after(1): # Timeout after 1 second
102-
await slow_request_complete.wait()
92+
# release the slow request not to have hanging process
93+
slow_request_lock.set()
10394

10495
# Third call should work (fast operation),
10596
# proving server is still responsive

0 commit comments

Comments
 (0)