Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flaky test: StdioServerTransport.DisposeAsync() can hang #143

Open
halter73 opened this issue Mar 30, 2025 · 2 comments
Open

Flaky test: StdioServerTransport.DisposeAsync() can hang #143

halter73 opened this issue Mar 30, 2025 · 2 comments
Labels
bug Something isn't working test Issue related to tests

Comments

@halter73
Copy link
Contributor

halter73 commented Mar 30, 2025

The active test run was aborted. Reason: Test host process crashed
Data collector 'Blame' message: The specified inactivity time of 7 minutes has elapsed. Collecting hang dumps from testhost and its child processes.

Test Run Aborted.
Total tests: Unknown
     Passed: 189
    Skipped: 3
 Total time: 7.6249 Minutes
Results File: /home/runner/work/csharp-sdk/csharp-sdk/testresults/_fv-az[221](https://github.com/modelcontextprotocol/csharp-sdk/actions/runs/14150315138/job/39642597376?pr=142#step:10:222)0-804_2025-03-29_23_16_37.trx

The active Test Run was aborted because the host process exited unexpectedly. Please inspect the call stack above, if available, to get more information about where the exception originated from.
The test running when the crash occurred: 
ModelContextProtocol.Tests.Transport.StdioServerTransportTests.Constructor_Should_Initialize_With_Valid_Parameters

This test may, or may not be the source of the crash.

https://github.com/modelcontextprotocol/csharp-sdk/actions/runs/14150315138/job/39642597376?pr=142

I think there's good reason to believe StdioServerTransportTests.Constructor_Should_Initialize_With_Valid_Parameters is the source of the hang considering Constructor_Should_Initialize_With_Valid_Parameters is the only in-proc test that tries to read from the real stdin and then cancel the read gracefully. I'm pretty sure we're cancelling the ReadLineAsync operation correctly, so we might have to look into the Unix ConsolePal.

@halter73 halter73 added the bug Something isn't working label Mar 30, 2025
@halter73 halter73 changed the title Flaky test: Disposing StdioServerTransport can hang asynchronously when reading from stdin Flaky test: StdioServerTransport.DisposeAsync() can hang on (ubuntu-latest, Release) Mar 30, 2025
@eiriktsarpalis eiriktsarpalis changed the title Flaky test: StdioServerTransport.DisposeAsync() can hang on (ubuntu-latest, Release) Flaky test: StdioServerTransport.DisposeAsync() can hang Mar 31, 2025
@eiriktsarpalis
Copy link
Contributor

Updated the title to reflect that this hands on Windows as well: #160 (comment)

@halter73
Copy link
Contributor Author

Thanks. I was just about to do the same thing. More context:

@stephentoub stephentoub added the test Issue related to tests label Apr 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working test Issue related to tests
Projects
None yet
Development

No branches or pull requests

3 participants