Bring up to 0.1.13 conformance (#1254)

This commit is contained in:
Stephen Toub 2026-02-10 11:33:52 -05:00 • committed by GitHub
commit 27b5eb8031
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -70,7 +70,9 @@ public class TaskCancellationIntegrationTests : ClientServerTestBase
{
Name = "long-running-tool",
Arguments = EmptyArguments(),
Task = new McpTaskMetadata { TimeToLive = TimeSpan.FromMilliseconds(200) }
// Use a TTL long enough that thread pool scheduling delays on loaded CI machines
// don't cause the CTS to fire before the tool lambda begins executing.
Task = new McpTaskMetadata { TimeToLive = TimeSpan.FromSeconds(5) }
},
cancellationToken: TestContext.Current.CancellationToken);
@ -333,13 +335,16 @@ public class TaskCancellationConcurrencyTests : ClientServerTestBase
RegisterMarker("short-ttl");
RegisterMarker("long-ttl");
// Start task with short TTL (200ms)
// Start task with short TTL. Use a TTL long enough that thread pool scheduling
// delays on loaded CI machines don't cause the CTS to fire before the tool
// lambda begins executing (CancelAfter starts counting at task creation, not
// when the tool's Task.Run is scheduled).
var shortTtlResult = await client.CallToolAsync(
new CallToolRequestParams
{
Name = "trackable-tool",
Arguments = CreateMarkerArgs("short-ttl"),
Task = new McpTaskMetadata { TimeToLive = TimeSpan.FromMilliseconds(200) }
Task = new McpTaskMetadata { TimeToLive = TimeSpan.FromSeconds(5) }
},
cancellationToken: TestContext.Current.CancellationToken);