Skip to content

Fix StdioServerTransportTests to use Debug logging level instead of Trace - #1209

Merged
stephentoub merged 2 commits into
mainfrom
copilot/address-comment-from-pr-1191
Jan 29, 2026
Merged

Fix StdioServerTransportTests to use Debug logging level instead of Trace#1209
stephentoub merged 2 commits into
mainfrom
copilot/address-comment-from-pr-1191

Conversation

CopilotAI commented Jan 29, 2026

Copy link
Copy Markdown
Contributor

Addresses unresolved feedback from #1191: the test class was overriding LoggerFactory to use LogLevel.Trace for all tests, but Debug should remain the default since Trace is too verbose for general test output.

Changes

  • Remove class-level LoggerFactory override from constructor (now uses base class default of Debug)
  • Update SendMessageAsync_Should_Log_At_Trace_Level and ReadMessagesAsync_Should_Log_Received_At_Trace_Level to create local trace-level logger factories for their specific needs
// Each trace-level test now creates its own logger infrastructurevarmockLoggerProvider=newMockLoggerProvider();usingvartraceLoggerFactory=LoggerFactory.Create(builder =>{builder.AddProvider(XunitLoggerProvider);builder.AddProvider(mockLoggerProvider);builder.SetMinimumLevel(LogLevel.Trace);});
Original prompt

Address this comment that wasn't handled before the PR was merged: @modelcontextprotocol/csharp-sdk/pull/1191


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…g level
Address feedback from PR #1191: The class-level LoggerFactory override was removed
from the constructor (now uses base class default of Debug). The trace-level
logging tests now create their own local MockLoggerProvider and trace-level
LoggerFactory to properly test Trace-level logging without affecting other tests.
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
CopilotAI changed the title [WIP] Address comment from merged PR 1191Fix StdioServerTransportTests to use Debug logging level instead of TraceJan 29, 2026
CopilotAI requested a review from stephentoubJanuary 29, 2026 20:15
@stephentoub
stephentoub marked this pull request as ready for review January 29, 2026 20:20
@stephentoub
stephentoub merged commit 482e311 into mainJan 29, 2026
10 of 17 checks passed
@stephentoub
stephentoub deleted the copilot/address-comment-from-pr-1191 branch January 29, 2026 22:20
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@halter73@stephentoub