Skip to content

test(mcp): preserve startup failure diagnostics - #1904

Merged
Aaronontheweb merged 2 commits into
devfrom
fix/mcp-notification-startup-flake
Aug 12, 2026
Merged

test(mcp): preserve startup failure diagnostics#1904
Aaronontheweb merged 2 commits into
devfrom
fix/mcp-notification-startup-flake

Conversation

@Aaronontheweb

Copy link
Copy Markdown
Collaborator

Summary

  • assert the MCP connection contract before reading the notification lease
  • forward full manager exceptions to test output and cover failed stdio startup diagnostics

Evidence and scope

Windows run 31560045253, job 94000330013, failed after StartAsync because the test read a null NotificationLease. The test used a null logger and did not call the existing AssertConnected helper, so the run discarded the startup exception that would identify the production cause.

This change does not alter MCP runtime behavior, timeout values, retries, or lease assertions. It makes any connection failure fail first with the server state and status message. It also retains the manager's full exception in test output. The negative test proves that a missing stdio process reports Unreachable and Failed to reach MCP server, and that its command and transport exception reach the output, before the lease assertion.

This PR does not prove or fix an underlying production MCP startup defect. If the intermittent Windows startup failure remains, the next run will retain the exception needed for a causal follow-up.

Verification

  • focused MCP notification and manager tests: 22 passed
  • complete Netclaw.Daemon.Tests Release suite: 1,019 passed, repeated 3 times
  • dotnet build Netclaw.slnx -c Release --no-restore: passed with 0 warnings and 0 errors
  • changed-file dotnet format --verify-no-changes: passed
  • pwsh ./scripts/Add-FileHeaders.ps1 -Verify: passed
  • changed-file Slopwatch: 0 findings

The repo-wide Slopwatch scan still reports one pre-existing warning in PowerShellHostProbeTests.cs; this change does not touch that file.

@Aaronontheweb Aaronontheweb added mcp Model context protocol server / client issues. observability labels Aug 12, 2026
@Aaronontheweb
Aaronontheweb enabled auto-merge (squash) August 12, 2026 14:43
@Aaronontheweb
Aaronontheweb force-pushed the fix/mcp-notification-startup-flake branch from 038ac8b to c143f99 Compare August 12, 2026 15:20
@Aaronontheweb
Aaronontheweb merged commit 63372dd into dev Aug 12, 2026
23 checks passed
@Aaronontheweb
Aaronontheweb deleted the fix/mcp-notification-startup-flake branch August 12, 2026 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mcp Model context protocol server / client issues. observability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant