Skip to content

Commit 45b8b2f

Browse files
Copilotbcollamore
andauthored
fix: Increase MCP test timeout from 180s to 240s (#1030)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: bcollamore <57269455+bcollamore@users.noreply.github.com>
1 parent 696dd86 commit 45b8b2f

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ __pycache__/
260260
*.pyd
261261

262262
# MCP Server temporary files
263+
.mcp_state/
263264
tools/mcp/Directory.Build.props.backup
264265
tools/mcp/*.log
265266
tools/mcp/test-results.trx

tools/mcp/mcp_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def build_strict() -> Dict[str, Any]:
4141
"""dotnet build solution with warnings as errors."""
4242
return _mod().build_strict()
4343

44-
@mcp.tool
44+
@mcp.tool(annotations={"timeout": 240})
4545
def run_tests() -> Dict[str, Any]:
4646
"""Run tests against main test project."""
4747
return _mod().run_tests()

tools/mcp/ra_tools.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ def run_tests() -> Dict[str, Any]:
8989
test_bin = BASE_DIR/"Philips.CodeAnalysis.Test"/"bin"/"Release"
9090
if test_bin.exists():
9191
cmd.append("--no-build")
92-
timeout = 600 if did_restore_now else 180
92+
# Tests take ~48 seconds to run 1903 tests. Use 240 seconds (4 minutes) to ensure completion.
93+
# If restore was just done, allow 600 seconds (10 minutes) total.
94+
timeout = 600 if did_restore_now else 240
9395
rc, out = _run(cmd, timeout=timeout)
9496

9597
test_results = {"passed":0,"failed":0,"skipped":0,"total":0,"duration":""}
@@ -230,13 +232,14 @@ def analyze_coverage() -> Dict[str, Any]:
230232
_run(["dotnet", "tool", "install", "--global", "dotnet-coverage", "--version", "17.9.6"], timeout=300)
231233

232234
coverage_bin = _coverage_exe()
235+
# Coverage collection with test execution takes longer than regular tests (~60-90 seconds)
233236
rc, out = _run([
234237
coverage_bin, "collect",
235238
"dotnet", "test", "Philips.CodeAnalysis.Test/Philips.CodeAnalysis.Test.csproj",
236239
"--configuration", "Release", "--no-build",
237240
"--logger", "trx;LogFileName=coverage-test-results.trx",
238241
"--output-format", "xml", "--output", "coverage.xml"
239-
])
242+
], timeout=300)
240243

241244
analysis = {"status": "success" if rc == 0 else "failure", "overall_coverage": 0.0, "uncovered_lines": [], "suggestions": []}
242245
xml_path = BASE_DIR / "coverage.xml"

0 commit comments

Comments
 (0)