memory: file-lock test "stops refreshing a lock that was broken and re-taken" races its own heartbeat on a slow runner
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 76/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
- Área
- testing
Línea de trabajo
Empieza por src/memory/__tests__/file-lock.test.ts, en el test de withFileLock llamado «stops refreshing a lock that was broken and re-taken while it ran». Lee cómo se coordinan el utimes simulado, el spy de readFile y los temporizadores reales; después, haz que la aserción sea independiente de la planificación del runner. Ejecuta el test específico con verify:no-test-retries; estará terminado cuando pase de forma fiable y sin reintentos en CI lento.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 92k
- Forks
- 12k
- Merge medio
- 3 h 46 min
- PR fusionados (30 d)
- 206
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de modelcontextprotocol/servers
-
`interface-diff` discards the git error when resolving its default base and reports the wrong causeAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
modelcontextprotocol/servers#5636 ·
Los mantenedores suelen responder en 1 día
-
documentation server-memory v2
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
modelcontextprotocol/servers#5609 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug server-memory v2
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
modelcontextprotocol/servers#5635 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug server-memory v2
Dificultad 5/5 Más de una semana Aptitud para principiantes 42/100
modelcontextprotocol/servers#5624 ·
Los mantenedores suelen responder en 1 día
-
enhancement v2
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
modelcontextprotocol/servers#5611 ·
Los mantenedores suelen responder en 1 día
Todos los issues de modelcontextprotocol/servers
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
hurttlocker/o8#6535 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
Los mantenedores suelen responder en 1 día
-
area: backend bug priority: low
Dificultad 2/5 1-3 horas Aptitud para principiantes 92/100
snapotter-hq/SnapOtter#4856 ·
Los mantenedores suelen responder en 1 día
-
bug follow-up
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
spellshift/realm#2509 ·
Los mantenedores suelen responder en 1 día