memory: file-lock test "stops refreshing a lock that was broken and re-taken" races its own heartbeat on a slow runner
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 76/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- typescript
- 領域
- testing
調査の方向性
src/memory/__tests__/file-lock.test.tsから始め、withFileLockの「stops refreshing a lock that was broken and re-taken while it ran」という名前のテストを確認してください。モックされたutimes、readFileのスパイ、実際のタイマーがどのように連携するかを読み、そのうえでアサーションがランナーのスケジューリングに左右されないようにしてください。verify:no-test-retriesを指定して対象のテストを実行してください。遅いCIでも再試行なしで安定して成功すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Problem
src/memory/__tests__/file-lock.test.ts > withFileLock > stops refreshing a lock that was broken and re-taken while it ran (#5418) failed on CI with AssertionError: expected 0 to be greater than 0 (Coverage memory, run 44417378815, job 135201148642, on PR #5628's caught-up head). That PR changes only src/git/; the test is unchanged on v2/main, including after #5623.
Cause
The test runs on real timers (staleMs: 200, so a heartbeat every 100 ms). The first heartbeat's utimes is mocked to replace the lock with another owner's and then resolve replacement. The operation then clears the readFile spy and expects, within a 250 ms sleep, at least one read of the lock: the next heartbeat seeing the new token and stopping.
On a loaded runner (the coverage leg is instrumented), the next heartbeat can read the lock before the operation resumes and clears the spy. That read is wiped, the heartbeat stops as intended, and no further read follows, so the count is 0. The behavior under test is correct; the assertion depends on scheduling.
Expected
The test passes regardless of runner speed, with no retry (verify:no-test-retries). For example: drive the heartbeat with fake timers, or count reads from the moment the replacement is made (inside the mocked utimes) instead of clearing after the operation resumes.
- 主要言語
- TypeScript
- スター
- 92k
- フォーク
- 12k
- 平均マージ
- 3時間 46分
- マージ済み PR(30日)
- 206
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
modelcontextprotocol/servers のほかの issue
-
`interface-diff` discards the git error when resolving its default base and reports the wrong causeオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
modelcontextprotocol/servers#5636 ·
メンテナーはふだん 1 日以内に返信
-
documentation server-memory v2
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
modelcontextprotocol/servers#5609 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug server-memory v2
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
modelcontextprotocol/servers#5635 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug server-memory v2
難易度 5/5 1週間以上 初心者へのやさしさ 42/100
modelcontextprotocol/servers#5624 ·
メンテナーはふだん 1 日以内に返信
-
enhancement v2
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
modelcontextprotocol/servers#5611 ·
メンテナーはふだん 1 日以内に返信
modelcontextprotocol/servers の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
hurttlocker/o8#6535 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
メンテナーはふだん 1 日以内に返信
-
area: backend bug priority: low
難易度 2/5 1〜3時間 初心者へのやさしさ 92/100
snapotter-hq/SnapOtter#4856 ·
メンテナーはふだん 1 日以内に返信
-
bug follow-up
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
spellshift/realm#2509 ·
メンテナーはふだん 1 日以内に返信