Tool-layer tests fail when DirectShow device enumeration hangs

未关闭 适合新手
#508 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
78/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
领域
backend, testing

调研方向

从 src/__tests__/integration/toolLayer.test.ts 中的用例表和跳过处理开始,尤其关注 list_audio_devices 和 list_video_devices 用例。将它们的预期与现有跳过的用例以及 winOnly 分支进行比较。将挂起的 DirectShow 枚举报告为跳过,或接受其文档说明的超时错误,然后运行工具层测试套件;当这些用例在枚举会挂起的机器上不再失败时,任务即告完成。

由索引模型根据 Issue 内容生成。

描述

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
主要语言
TypeScript
星标
1
派生
4
平均合并
3 天 4 小时
30 天内合并 PR
4

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

TMHSDigital/screencast-mcp 的其他 Issue

查看 TMHSDigital/screencast-mcp 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。