Tool-layer tests fail when DirectShow device enumeration hangs

Aperta Adatta ai principianti
#508 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
node.js, typescript
Ambito
backend, testing

Direzione di ricerca

Inizia dalla tabella dei casi e dalla gestione dei test saltati in src/__tests__/integration/toolLayer.test.ts, soprattutto dai casi list_audio_devices e list_video_devices. Confronta le loro aspettative con i casi già saltati e con il ramo winOnly. Contrassegna come saltata un’enumerazione DirectShow che si blocca oppure accetta il relativo errore di timeout documentato, quindi esegui la suite dei test del livello degli strumenti; il lavoro è completato quando questi casi non falliscono più sulle macchine in cui l’enumerazione si blocca.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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
Lingua principale
TypeScript
Stelle
1
Fork
4
Merge medio
3g 4h
PR unite (30g)
4

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di TMHSDigital/screencast-mcp

Tutte le issue di TMHSDigital/screencast-mcp

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.