Commit b6efae1
Fix flaky OutgoingFilter_MultipleFilters_ExecuteInOrder test
The outermost filter's 'after' callback runs after the response has been
sent to the client via next(). In stateless/SSE mode, ListToolsAsync can
return before the server-side filter pipeline finishes executing the
'after' callbacks. Assert.Equal then enumerates the executionOrder list
concurrently with the filter adding to it, causing 'Collection was
modified' InvalidOperationException.
Fix by waiting for the outermost filter's 'after' callback to signal
completion before asserting on the execution order.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 54caccc commit b6efae1
1 file changed
+7
-0
lines changedLines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
394 | 394 | | |
395 | 395 | | |
396 | 396 | | |
| 397 | + | |
397 | 398 | | |
398 | 399 | | |
399 | 400 | | |
| |||
411 | 412 | | |
412 | 413 | | |
413 | 414 | | |
| 415 | + | |
414 | 416 | | |
415 | 417 | | |
416 | 418 | | |
| |||
439 | 441 | | |
440 | 442 | | |
441 | 443 | | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
442 | 449 | | |
443 | 450 | | |
444 | 451 | | |
| |||
0 commit comments