Commit 6ba9bb9
test(audience-http): accept HttpClient's TaskCanceledException wrap
SendBatchAsync_CallerCancelled_Throws was asserting the exact type
`OperationCanceledException` via `Assert.ThrowsAsync`. HttpClient
internally catches the OCE our mock throws and rethrows it as
`TaskCanceledException` (a subclass), so `ThrowsAsync` — which is
exact-type — missed.
Switch to `CatchAsync<OperationCanceledException>`, which accepts the
whole cancellation family. This is what we actually want to assert:
"cancellation propagated", not "HttpClient happens to throw this exact
subclass".
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 81ff2e9 commit 6ba9bb9
1 file changed
Lines changed: 4 additions & 1 deletion
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
415 | 415 | | |
416 | 416 | | |
417 | 417 | | |
418 | | - | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
419 | 422 | | |
420 | 423 | | |
421 | 424 | | |
| |||
0 commit comments