Flaky capture smoke: the resumed segment is sometimes missing from the paused recording

未关闭
#331 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
55/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
typescript
领域
backend, testing

调研方向

Start with the Windows capture smoke in src/__tests__/captureSmoke.test.ts:93-130, then trace runStop to joinSegments in src/utils/lifecycle.ts and the resume and finalization paths in src/utils/pause.ts and src/utils/recorder.ts. Run RUN_CAPTURE_SMOKE=1 npx vitest run src/__tests__/captureSmoke.test.ts on Windows. Done means failures report segment count, part durations, and join errors, and the root cause is identified with the resumed segment retained or the test waiting until it has frames.

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

描述

ci priority: medium testing

Summary

The Windows CI capture smoke "leaves a paused stretch out of the file and the markers (#200)" fails intermittently, including its retry, and a red run blocks the release. In the failures the stopped recording holds only the first segment, or has a gap over 1 s, so the resumed segment is missing or late in the join.

Where

  • src/__tests__/captureSmoke.test.ts:93-130 (start, 2 s, pause, 3 s, resume, 2 s, stop)
  • Join path: src/utils/lifecycle.ts (runStop -> joinSegments), src/utils/pause.ts (finishSegments), src/utils/recorder.ts (resume spawn)

Details

Seen on build-and-test (windows-latest, 22) and (windows-latest, 24):

AssertionError: 102 frames over 3.354583s, first segment 3.353s: expected 3.354583 to be greater than 4.353
AssertionError: widest gap 1.367973s; 100 frames over 9.415311s, first segment 3.479s: expected 1.367973 to be less than 1

In the first kind the output is exactly the first segment: the resumed segment contributed no frames, although the test records for 2 s after resume_recording returns. Commits 8a4fad6, e25cc00 and 265975b failed this way; neighbouring commits passed. It did not reproduce locally (3 runs alone and one under the full suite, Windows 11).

Impact

Intermittent red CI on main; per the release flow a red run skips the npm publish. If the resumed segment is really being lost, users lose footage after a pause.

Suggested fix

  1. Have the test print the stop result's segments (count and any join error) and the per-part durations, so the next failure shows whether the second part is empty, missing or dropped by the join.
  2. Check whether a resumed gdigrab capture that is stopped soon after starting can finalize with zero frames on a slow runner, and whether joinSegments then silently skips it.

Acceptance criteria

  • A failure reports the segment count, part durations and any join error
  • Root cause identified; either the join keeps the resumed part or the test waits for it to have frames

Getting started

  • Relevant files: src/__tests__/captureSmoke.test.ts, src/utils/lifecycle.ts, src/utils/pause.ts, src/utils/recorder.ts
  • How to run tests: RUN_CAPTURE_SMOKE=1 npx vitest run src/__tests__/captureSmoke.test.ts on Windows

Related: #200


Filed by repo-audit/fix-issues at a6cfc9b. Severity: medium. Effort: M. audit-key: testing|src/__tests__/captureSmoke.test.ts|paused-stretch-missing-resume-segment

主要语言
TypeScript
星标
1
派生
4
平均合并
14 小时 8 分钟
30 天内合并 PR
48

环境准备

从这里开始

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

TMHSDigital/screencast-mcp 的其他 Issue

查看 TMHSDigital/screencast-mcp 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

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