Repository navigation
fix(test): await provider debug cleanup before TempDir teardown (#1956) - #1982
Merged
Merged
Conversation
1lck
marked this pull request as ready for review
November 15, 2026 13:05
Contributor
Author
There was a problem hiding this comment.
Lithe Review
结论:暂不建议合并。 静态审查此次测试清理改动,未发现可确认的新代码缺陷;但目标分支与验证仍需处理。
- 当前目标为
preview,而项目已切换到main开发。建议将改动迁移到main,重新核对 diff 和基线,再进行验证。PR 当前为 Ready,但正文仍写 Draft,建议同步实际状态。 - Windows CI 和矩阵检查失败;目前检查接口没有失败日志,无法判断是否由此改动引入,请查看日志并对照基线。
- 已对精确 head 的修改文件运行
gofmt -l,无输出。尚未运行应用级测试:该 head 需要固定 Core6477e9a,本次可用 Bot 未提供该组织仓库读取,现有本地 Core 版本不同。迁移后请以匹配依赖运行相关测试,特别是原报告平台 macOS 的重复测试。
本评审仅为静态检查和格式检查,不是实测通过或合并批准。
Owner
|
目标分支已从 |
closeProject 遇到运行中的会话会先弹退出确认,finishCloseProject 没有执行, harness 的兜底路径只取消项目上下文。适配器进程退出后由 untrack 写偏好目录里的 进程台账,这个写入不在 a.tasks 里,和 TempDir 删除竞争。兜底路径按 finishCloseProject 的顺序释放测试、调试、运行、构建和 VCS 会话,h.app.wait() 随后等清理任务结束。去掉单个测试里的重复清理。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
关联 Issue / Linked issue
PR 类型 / Type
改动说明 / What changes
背景 / Why
TestProviderDebugStartsTheNamedAdapter启动了真正的调试会话,测试返回时会话还在运行。harness 收尾调用closeProject,但运行中的会话会让它先弹退出确认,finishCloseProject(其中的stopDebugForProject、stopRunsForProject等)没有执行,兜底路径只做p.cancel()。适配器进程随上下文被杀后,buildprocess在command.Wait()之后调用untrack()改写偏好目录里的进程台账;这个写入不在a.tasks里,h.app.wait()等不到,于是和t.TempDir的RemoveAll竞争,偶发directory not empty。改动 / Changes
desktop/internal/workbench/app_test.go:harness 兜底路径按finishCloseProject的顺序先调用stopTestsForProject、stopDebugForProject、stopRunsForProject、stopBuild、stopVcs,再取消项目上下文。调试会话的清理任务会等process.Wait()(台账写入之后才返回)和exitObserved,随后h.app.wait()等这些任务结束,TempDir 才删除。所有用 harness 的调试、运行、测试用例都被覆盖,不只这一个测试。desktop/internal/workbench/title_run_test.go:保留拿不到会话时立即t.Fatal的判断;去掉 Bot 最初在单个测试里加的t.Cleanup,避免两套清理逻辑。不在本 PR 范围内 / Out of scope
类型专属:fix
复现与根因
scripts/desktop/desktop-go.sh test ./internal/workbench -count=1;旧测试返回时有尚未完成的调试会话清理。TempDir RemoveAll cleanup: ... directory not empty。closeProject因退出确认没有走到finishCloseProject,兜底路径没有释放调试、运行、测试会话,进程台账的写入晚于 TempDir 删除。检查项
范围检查 / Scope checks
功能矩阵 / Feature matrix
N/A:仅修复测试,不改变用户可观察的产品行为。
插件归属 / Plugin ownership
UI 验证 / UI evidence
N/A:纯无头会话生命周期测试,没有 UI、样式或文案变更,因此无截图证据;应使用测试报告验证。
统一日志系统 / Structured logging
N/A:未改动产品日志或终态。
界面文案 / i18n
N/A:未改动任何界面文案。
逻辑归属 / Logic placement
N/A:仅修改测试清理流程,不新增业务逻辑。
性能与内存 / Performance and memory
N/A:不改变产品运行时;测试清理显式等待已存在的异步退出。
设置 / Settings
N/A:不修改设置项或加载行为。
插件契约 / Plugin contract
N/A:没有契约或宿主方法修改。
发行包与资源 / Bundle and resources
N/A:未增加运行时资源、打包资源或目录。
无用代码与重构 / Dead code and refactoring
验证 / Verification
AGENTS.md、develop-lithe、write-stable-tests,检查releaseDebugSession、stopDebug、newHarnessWithDriver./.agents/skills/write-stable-tests/scripts/verify-test-stability.sh --base origin/main./.agents/skills/write-stable-tests/scripts/test-stability-macos.sh --package ./internal/workbench -- --filter 'TestProviderDebugStartsTheNamedAdapter'cd desktop && ../scripts/desktop/desktop-go.sh test ./internal/workbench -run '^TestProviderDebugStartsTheNamedAdapter$' -count=20cd desktop && ../scripts/desktop/desktop-go.sh test ./internal/workbench -count=1未能执行的检查和原因: 当前执行容器没有仓库源码、Core/Viva 编译依赖与 macOS/Windows 测试环境;GitHub 内容读取和 Bot 提交不等于运行或实测。请在具备依赖的平台执行上述测试并核对 HTML/JUnit 单测试耗时后再转为 Ready。
提交前确认 / Final checks
main,目标main。