Fix process crash when testing Stderr (#1449)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Eric StJohn 2026-04-06 11:29:00 -07:00 • committed by GitHub
commit 2e7209c35a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -27,8 +27,11 @@ public class StdioServerTransportTests : LoggedTest
[Fact]
public async Task Constructor_Should_Initialize_With_Valid_Parameters()
{
// Act
await using var transport = new StdioServerTransport(_serverOptions);
// Use StreamServerTransport with Stream.Null rather than StdioServerTransport.
// StdioServerTransport opens Console.OpenStandardInput() which permanently
// blocks a thread pool thread on the test host's stdin. StdioServerTransport
// should only be instantiated in a dedicated child process.
await using var transport = new StreamServerTransport(Stream.Null, Stream.Null, _serverOptions.ServerInfo?.Name);
// Assert
Assert.NotNull(transport);