test(fetchers): a released model-cache flight leaves its 15s deadline armed, so shuffled runs fail on order
メンテナーはふだん 3 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 72/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- node.js, typescript
- 領域
- backend, testing-qa
調査の方向性
Start with src/api/providers/fetchers/modelCache.ts, especially dedupedFetch around lines 413–478, and inspect how the timeout and waiter view are handled when the last waiter detaches. Reproduce with the Vitest command in the issue using seed 102, then check the model cache spec under shuffled order. Done when the released flight's timer and waiter view cannot affect later tests, and the shuffled run passes.
索引モデルが issue の本文から書いたものです。
説明
Symptom
Any shuffled Vitest mix that includes src/api/providers/fetchers/__tests__/modelCache.spec.ts fails with unhandled rejections and wrong call counts (fetchModels called 2 times). The failure count depends on the seed: 2, 4, 11 or 15 failures. Runs in declaration order pass, so CI is green today.
Measured on main content
- Fails at requesty head
3f59a3fa93ccwith seed 100 (4 failures) and seed 102 (11 failures). - Fails identically with the requesty spec files reverted to base
75a93a9d9acc: seed 100 gives 4, seed 102 gives 15. So the defect is not introduced by the abort-signal units. - Repro:
cd src && npx vitest run api/providers/fetchers/__tests__/modelCache.spec.ts api/providers/__tests__/requesty.modelCache.spec.ts --sequence.shuffle --seed 102 - A single-flight isolation spec that does not use the shared cache (
requesty.modelCache.spec.ts) is green under shuffle at seeds 42 and 7 on its own.
Mechanism
dedupedFetch arms a real 15 second deadline: const controller = new AbortController(), const timeoutSignal = AbortSignal.timeout(MODEL_CATALOG_FETCH_TIMEOUT_MS), const onTimeout = () => controller.abort(timeoutSignal.reason), timeoutSignal.addEventListener("abort", onTimeout, { once: true }) (src/api/providers/fetchers/modelCache.ts:413-417). removeTimeoutListener() runs only on the settle paths (:435, :441). A flight whose last waiter detaches is aborted and released synchronously (:477-478), but the armed AbortSignal.timeout is a live Node timer for the rest of the run. When it fires during a later test it aborts a stale waiter's view signal, and the rejection lands in whichever test is currently executing. The flight's own promise has a terminal observer (void promise.catch(() => {}) at :452), so the unhandled rejection comes from the per-waiter view side, not from the flight.
Expected
Either release the deadline with the flight - disarm the timeout when the last waiter detaches - or have the affected specs dispose their flights and pending fetches in afterEach, so test order cannot change results. The point is that the timer and the waiter view must not outlive the test that created them.
Why it matters now
The abort-signal series adds more specs that park a model lookup and release it late. Every one of them inherits this order dependency, and any move to randomised ordering in CI would turn it into a permanent flake.
- 主要言語
- TypeScript
- スター
- 2k
- フォーク
- 301
- 平均マージ
- 3日 14時間
- マージ済み PR(30日)
- 103
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Zoo-Code-Org/Zoo-Code のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
Zoo-Code-Org/Zoo-Code#2773 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
Zoo-Code-Org/Zoo-Code#2717 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
Zoo-Code-Org/Zoo-Code#2515 ·
メンテナーはふだん 3 日以内に返信
-
fix(scripts): stryker-diff.mjs spawns the extensionless .bin shim and cannot run on Windows対応中かも @easonLiangWorldedtech が 15 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Zoo-Code-Org/Zoo-Code#2514 ·
メンテナーはふだん 3 日以内に返信
-
[BUG] search_files hides matching text on long lines対応中かも @DananjayaNadun が 9 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
Zoo-Code-Org/Zoo-Code#2496 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 3 日以内に返信
Zoo-Code-Org/Zoo-Code の issue をすべて見る
似ている issue
-
needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
EPPIcenter/sampledb3#162 ·
-
Particle-1 modelオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
tashfeenahmed/freellmapi#2169 ·
メンテナーはふだん 1 日以内に返信
-
via-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
メンテナーはふだん 1 日以内に返信
-
🎙️ task - feat(mechanic): pave git.pull.close, a close of a superseded pull with its why on recordオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
ehmpathy/rhachet-roles-ehmpathy#1576 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
vercel-labs/ui#1563 ·
メンテナーはふだん 1 日以内に返信