memory: file-lock test "stops refreshing a lock that was broken and re-taken" races its own heartbeat on a slow runner
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 76/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- typescript
- Domínio
- testing
Direção de pesquisa
Comece por src/memory/__tests__/file-lock.test.ts, no teste de withFileLock chamado “stops refreshing a lock that was broken and re-taken while it ran.” Leia como o utimes simulado, o spy de readFile e os temporizadores reais se coordenam; em seguida, torne a asserção independente do agendamento do runner. Execute o teste específico com verify:no-test-retries; ele estará concluído quando passar de forma confiável, sem novas tentativas, em CI lento.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- TypeScript
- Estrelas
- 92k
- Forks
- 12k
- Merge médio
- 3h 46min
- PRs com merge (30d)
- 206
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de modelcontextprotocol/servers
-
`interface-diff` discards the git error when resolving its default base and reports the wrong causeAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
modelcontextprotocol/servers#5636 ·
Mantenedores costumam responder em até 1 dia
-
documentation server-memory v2
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 90/100
modelcontextprotocol/servers#5609 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
bug server-memory v2
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 48/100
modelcontextprotocol/servers#5635 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
bug server-memory v2
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 42/100
modelcontextprotocol/servers#5624 ·
Mantenedores costumam responder em até 1 dia
-
enhancement v2
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 48/100
modelcontextprotocol/servers#5611 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de modelcontextprotocol/servers
Issues semelhantes
-
bug impact:low Team: SecuritySolution Team:Defend Workflows v9.6.0
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
elastic/kibana#306401 · 3 comentários ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
agentes-chat/agentes-chat#927 ·
Mantenedores costumam responder em até 1 dia
-
[Bug]: Webapp workspace fails to render in Safari — "Can't find variable: requestIdleCallback"Abertacomp/desktop P2 type/bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
NousResearch/hermes-agent#157702 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
Mantenedores costumam responder em até 1 dia
-
e2e-failure ready-to-code
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 72/100
redhat-developer/rhdh-plugin-export-overlays#4794 · 1 comentário ·
Mantenedores costumam responder em até 1 dia