Skip to content

Codebase intelligence for AI and humans: code health scores, auto-generated docs, git analytics, dead code detection, and architectural decisions via MCP.

test(mcp): give the shared-selection timeout test a budget above the clock resolution (#4296)

Raghav Chamadiya5b3affdb40f4
diff --git a/tests/unit/server/mcp/test_test_selection_in_flight.py b/tests/unit/server/mcp/test_test_selection_in_flight.py
index 40a1c23d2..0fcf6d929 100644
--- a/tests/unit/server/mcp/test_test_selection_in_flight.py
+++ b/tests/unit/server/mcp/test_test_selection_in_flight.py
@@ -94,7 +94,9 @@ async def test_one_caller_timing_out_leaves_the_selection_to_the_other(
tmp_path, gated, monkeypatch
) -> None:
gate, runs = gated
- monkeypatch.setattr(_test_selection, "SELECTION_TIMEOUT_SECONDS", 0.01)
+ # Above the event loop's clock resolution (about 16 ms on Windows), so the
+ # first caller cannot time out before the second one joins.
+ monkeypatch.setattr(_test_selection, "SELECTION_TIMEOUT_SECONDS", 0.2)
first = _call(tmp_path, _change("a.py"))
await _settle()
monkeypatch.setattr(_test_selection, "SELECTION_TIMEOUT_SECONDS", 30.0)