Repository navigation
Commit 7cc45e3
committed
test(mistral): attach an abort listener so the first-cause test can observe it
What: the "keeps TimeoutError when the timeout fires before a later caller
abort" case now attaches an abort listener to the merged request signal from
its completePrompt mock, the way a real fetch does.
Why: on Node 24, AbortSignal.any() is a lazy composite. It materializes the
first-cause reason at abort time only when something is listening; with no
listener it re-reads the live source signals when .reason is first accessed,
so a later caller abort overwrote the earlier timeout reason and the handler
correctly reclassified the failure as AbortError. The test, not the product
code, was wrong: it asserted a reason the runtime never computed. The pinned
Node 22.23.4 behaves the same way, so this is not a version drift.
Impact: test-only. mistral.spec.ts goes from 49/50 to 50/50 on this base, and
the product classification logic in src/api/providers/mistral.ts is unchanged.1 parent 159c42e commit 7cc45e3
1 file changed
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
922 | 922 | | |
923 | 923 | | |
924 | 924 | | |
925 | | - | |
| 925 | + | |
926 | 926 | | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
927 | 932 | | |
928 | 933 | | |
929 | 934 | | |
| |||
0 commit comments