Files
NixOS/scripts/mcp-server/tests/test_performance.py
Danilo Reyes 8946ade5e8
Some checks failed
MCP Tests / mcp-tests (pull_request) Failing after 4s
mcp server done
2026-02-01 10:36:54 -06:00

26 lines
659 B
Python

"""Performance tests for MCP server handlers."""
from __future__ import annotations
import time
from mcp_server import tools
MAX_LATENCY_SECONDS = 2
def test_list_tools_is_fast() -> None:
"""ListTools responds under the latency target."""
start = time.perf_counter()
tools.list_tools_payload()
duration = time.perf_counter() - start
assert duration < MAX_LATENCY_SECONDS
def test_invoke_tool_is_fast() -> None:
"""InvokeTool responds under the latency target."""
start = time.perf_counter()
tools.invoke_tool("show-constitution", {})
duration = time.perf_counter() - start
assert duration < MAX_LATENCY_SECONDS