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

Abierto
#285 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
42/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
go
Área
testing-qa

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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
Lenguaje dominante
Go
Estrellas
0
Forks
0
Merge medio
7 h 42 min
PR fusionados (30 d)
111

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de seanb4t/codegraph-go

Todos los issues de seanb4t/codegraph-go

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.