Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions tests/ModelContextProtocol.Tests/Server/McpTaskStoreTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,9 @@ public async Task CancelTaskAsync_ViaStore_TransitionsToCancelled()
await using var client = await CreateMcpClientForServer();
var ct = TestContext.Current.CancellationToken;

// Create a slow task that won't complete on its own
// Create a task that won't complete on its own
var augmented = await client.CallToolAsTaskAsync(
new CallToolRequestParams { Name = "slow-tool" }, ct);
new CallToolRequestParams { Name = "long-running-tool" }, ct);

var taskId = augmented.TaskCreated!.TaskId;

Expand Down Expand Up @@ -701,6 +701,13 @@ public static async Task<string> SlowTool(CancellationToken cancellationToken)
return "slow result";
}

[McpServerTool(Name = "long-running-tool"), System.ComponentModel.Description("A tool that runs until cancelled")]
public static async Task<string> LongRunningTool(CancellationToken cancellationToken)
{
await Task.Delay(Timeout.Infinite, cancellationToken);
return "completed";
}

[McpServerTool(Name = "fast-tool"), System.ComponentModel.Description("A fast tool")]
public static string FastTool() => "fast result";

Expand Down
Loading