Add more tests (#51)
* Add more tests * Fix some code smells * Remove more code smells * Combine "ServerIntegrationTests" and "ClientIntegrationTests" because both are client integration tests just using different servers * Clean up resources after test * Improve kill logic for spawned child processes * Improved testability for Stdio * Fix SseIntegration tests
This commit is contained in:
parent
fe632617dc
commit
b5076263d1
1 changed files with 883 additions and 751 deletions
|
|
@ -25,6 +25,7 @@ internal abstract class McpJsonRpcEndpoint : IAsyncDisposable
|
|||
private int _nextRequestId;
|
||||
private readonly JsonSerializerOptions _jsonOptions;
|
||||
private readonly ILogger<McpClient> _logger;
|
||||
private bool _isDisposed;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="McpJsonRpcEndpoint"/> class.
|
||||
|
|
@ -398,6 +399,11 @@ internal abstract class McpJsonRpcEndpoint : IAsyncDisposable
|
|||
/// <returns></returns>
|
||||
protected async Task CleanupAsync()
|
||||
{
|
||||
if (_isDisposed)
|
||||
return;
|
||||
|
||||
_isDisposed = true;
|
||||
|
||||
_logger.CleaningUpEndpoint(EndpointName);
|
||||
|
||||
if (CancellationTokenSource != null)
|
||||
|
|
|
|||
Loading…
Reference in a new issue