memory: file-lock test "stops refreshing a lock that was broken and re-taken" races its own heartbeat on a slow runner
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 76/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- testing
Direzione di ricerca
Inizia da src/memory/__tests__/file-lock.test.ts, nel test di withFileLock chiamato “stops refreshing a lock that was broken and re-taken while it ran.” Leggi come si coordinano utimes simulato, lo spy di readFile e i timer reali, poi rendi l’asserzione indipendente dalla pianificazione del runner. Esegui il test mirato con verify:no-test-retries; il lavoro è concluso quando passa in modo affidabile senza tentativi aggiuntivi su CI lento.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- TypeScript
- Stelle
- 92k
- Fork
- 12k
- Merge medio
- 3h 46m
- PR unite (30g)
- 206
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di modelcontextprotocol/servers
-
`interface-diff` discards the git error when resolving its default base and reports the wrong causeAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
modelcontextprotocol/servers#5636 ·
I maintainer di solito rispondono entro 1 giorno
-
documentation server-memory v2
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
modelcontextprotocol/servers#5609 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug server-memory v2
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
modelcontextprotocol/servers#5635 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug server-memory v2
Difficoltà 5/5 Più di una settimana Idoneità per principianti 42/100
modelcontextprotocol/servers#5624 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement v2
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
modelcontextprotocol/servers#5611 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di modelcontextprotocol/servers
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
hurttlocker/o8#6535 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
I maintainer di solito rispondono entro 1 giorno
-
area: backend bug priority: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 92/100
snapotter-hq/SnapOtter#4856 ·
I maintainer di solito rispondono entro 1 giorno
-
bug follow-up
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
spellshift/realm#2509 ·
I maintainer di solito rispondono entro 1 giorno