Tool-layer tests fail when DirectShow device enumeration hangs

Aberta Para iniciantes
#508 0 comentários 0 reações 0 responsáveis Ver no GitHub

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
78/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
node.js, typescript
Domínio
backend, testing

Direção de pesquisa

Comece pela tabela de casos e pelo tratamento dos testes ignorados em src/__tests__/integration/toolLayer.test.ts, especialmente os casos list_audio_devices e list_video_devices. Compare as expectativas deles com os casos já ignorados e com o ramo winOnly. Marque como ignorada uma enumeração DirectShow que fique travada ou aceite o erro de timeout documentado; em seguida, execute a suíte da camada de ferramentas. O trabalho estará concluído quando esses casos não falharem mais em máquinas nas quais a enumeração fica travada.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

Problem

On a Windows machine where DirectShow device enumeration hangs, npm test fails two cases in src/__tests__/integration/toolLayer.test.ts (the #261 tool-layer suite):

  • list_audio_devices
  • list_video_devices

Both return isError: true with Could not enumerate audio devices (ffmpeg timed out after 12s.). The tools behave correctly: they time out and explain why (the fix from #40). The test is what fails, because it expects success from any case not marked expect: "error" or Windows-only.

Running ffmpeg -hide_banner -list_devices true -f dshow -i dummy directly on the same machine was still running after 90 s, so the hang is in the driver or ffmpeg, not in the server.

Expected

The suite already reports a case as skipped when the machine lacks its engine (Windows OCR, speech, a whisper model) rather than failing it. A device enumeration that times out is the same kind of environment gap, so these two cases should end as skipped (or pass by accepting the documented timeout error) instead of failing.

Suggested fix

One of:

  1. In the case table, accept the enumeration-timeout error as a valid outcome for list_audio_devices and list_video_devices: assert isError, a non-empty message, and no structuredContent, as the winOnly branch already does.
  2. Probe enumeration once in beforeAll with a short timeout and use it.skipIf on both cases when it hangs, so the result shows as skipped rather than passed.

Option 2 matches the suite's "reported as skipped, not passed" rule more closely.

Observed

  • Version 0.59.0, clean main at e65849b
  • Windows 11 Pro 10.0.26200
  • Result: 1648 passed, 30 skipped, 2 failed. typecheck, lint, and docs:check all pass
Linguagem predominante
TypeScript
Estrelas
1
Forks
4
Merge médio
3d 4h
PRs com merge (30d)
4

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de TMHSDigital/screencast-mcp

Todas as issues de TMHSDigital/screencast-mcp

Issues semelhantes

Mais issues de TypeScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.