chore(test): prove the short-lock scenario through a tool call

オープン
#285 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
42/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
go
領域
testing-qa

調査の方向性

Start with the existing tests in internal/graphstore/open_lock_test.go and internal/mcp/held_store_test.go, then read openLockRetrySleep in internal/graphstore/pebble_store.go and setRetrySleep in internal/graphstore/retry_test.go. The main work is exporting the retry seam through a graphstore subpackage such as locktest. Done means a new internal/mcp test holds the lock with locktest.HoldStoreLock, releases it during a codegraph_explore call, and asserts IsError is false and the text contains Alpha, with no timers.

索引モデルが issue の本文から書いたものです。

説明

area:mcp chore priority:low
What kind of chore?

Test infrastructure.

What needs doing?

The spec scenario "A short lock" is in openspec/specs/mcp-server/spec.md. It belongs to the requirement "A briefly locked store does not fail or hang a call."

That scenario is proven only at the graphstore.Open level. No test shows a tool call that returns a result without isError after the lock is released during the retry.

Existing coverage:

  • TestOpenConvergesWhenHolderCloses in internal/graphstore/open_lock_test.go:26 covers a release between two retry attempts.
  • TestToolCallOnHeldStore in internal/mcp/held_store_test.go:38 covers a long lock and expects isError.
  • TestToolCallWhileProcessHasStoreOpen in internal/mcp/held_store_test.go:15 does not hold a foreign lock.

Add a test in internal/mcp that holds the store lock with locktest.HoldStoreLock. The test must release the lock during a codegraph_explore call, then assert that IsError is false and that the text contains Alpha.

The blocker is the retry seam. openLockRetrySleep (internal/graphstore/pebble_store.go:106) is unexported, and setRetrySleep (internal/graphstore/retry_test.go:17) works only inside package graphstore. Package mcp cannot release the lock from inside the retry.

Expose the seam to other packages through an exported test helper in a graphstore subpackage such as locktest. The test must not use a timer, because the house rule forbids sleeps and wall-clock waits in tests.

Source: review note tes-1 in openspec/changes/archive/2026-11-11-shared-store-handle/review.md:33, from PR #282.

Why now?

PR #282 added the shared store handle that this scenario depends on. The review of that PR flagged this gap as tes-1. Without the test, a regression in how a tool call handles a briefly held lock can pass the suite.

Does this touch anything load-bearing?
  • None of these
Before submitting
  • I searched existing issues and this is not a duplicate
主要言語
Go
スター
0
フォーク
0
平均マージ
7時間 42分
マージ済み PR(30日)
111

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

seanb4t/codegraph-go のほかの issue

seanb4t/codegraph-go の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。