Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Feb 6, 2026

Refactors dispose timeout tests to use Task.WaitAsync instead of Task.WhenAny with Task.Delay, per review feedback on #1252.

Changes

  • Replaced verbose timeout pattern in 3 test methods across StreamableHttpClientConformanceTests and MapMcpStreamableHttpTests
  • Eliminated manual timeout comparison and assertions - Task.WaitAsync throws TimeoutException automatically

Before

var disposeTask = client.DisposeAsync().AsTask();
var completedTask = await Task.WhenAny(disposeTask, Task.Delay(TimeSpan.FromSeconds(10), cancellationToken));
Assert.True(disposeTask == completedTask, "DisposeAsync hung");
await disposeTask;

After

await client.DisposeAsync().AsTask().WaitAsync(TimeSpan.FromSeconds(10), cancellationToken);

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: halter73 <54385+halter73@users.noreply.github.com>
Copilot AI changed the title [WIP] Update PR to use Task.WaitAsync as requested in review feedback Replace Task.WhenAny timeout pattern with Task.WaitAsync Feb 6, 2026
Copilot AI requested a review from halter73 February 6, 2026 19:35
@halter73 halter73 closed this Feb 6, 2026
@halter73 halter73 deleted the copilot/sub-pr-1252 branch February 6, 2026 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants