feat: standardize timeout values to floats in seconds (#1766)

This commit is contained in:
Yugan 2025-12-19 17:52:56 +05:30 • committed by GitHub
commit 2aa1ad2a69
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,7 +1,6 @@
"""Test to reproduce issue #88: Random error thrown on response."""
from collections.abc import Sequence
from datetime import timedelta
from pathlib import Path
from typing import Any
@ -93,11 +92,9 @@ async def test_notification_validation_error(tmp_path: Path):
assert not slow_request_lock.is_set()
# Second call should timeout (slow operation with minimal timeout)
# Use 10ms timeout to trigger quickly without waiting
# Use very small timeout to trigger quickly without waiting
with pytest.raises(McpError) as exc_info:
await session.call_tool(
"slow", read_timeout_seconds=timedelta(microseconds=1)
) # artificial timeout that always fails
await session.call_tool("slow", read_timeout_seconds=0.000001) # artificial timeout that always fails
assert "Timed out while waiting" in str(exc_info.value)
# release the slow request not to have hanging process