File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
tests/ModelContextProtocol.AspNetCore.Tests Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -254,7 +254,7 @@ public async Task LongRunningToolCall_DoesNotTimeout_WhenNoEventStreamStore()
254254 {
255255 // Create a custom HttpClient with a very short timeout (1 second)
256256 // The tool will take 2 seconds to complete
257- using var shortTimeoutClient = new HttpClient ( SocketsHttpHandler )
257+ using var shortTimeoutClient = new HttpClient ( SocketsHttpHandler , disposeHandler : false )
258258 {
259259 BaseAddress = new Uri ( "http://localhost:5000/" ) ,
260260 Timeout = TimeSpan . FromSeconds ( 1 )
@@ -282,9 +282,7 @@ public async Task LongRunningToolCall_DoesNotTimeout_WhenNoEventStreamStore()
282282 Assert . Equal ( "Operation completed after 2000ms" , content . Text ) ;
283283 return ;
284284 }
285- catch ( TaskCanceledException ex ) when (
286- attempt < 2 &&
287- ex . ToString ( ) . Contains ( "HttpClient.Timeout" , StringComparison . Ordinal ) )
285+ catch ( OperationCanceledException ) when ( attempt < 2 )
288286 {
289287 // Retry intermittent timeout-related failures on slow CI machines.
290288 }
You can’t perform that action at this time.
0 commit comments