Repository navigation
fix(test): 隔离工作区监听的创建、替换和删除通知 - #2395
Merged
Merged
Conversation
Mucheen
marked this pull request as ready for review
November 24, 2026 13:43
Mucheen
marked this pull request as draft
November 24, 2026 14:21
Mucheen
marked this pull request as ready for review
November 24, 2026 14:44
26 tasks done
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
正式发布基线和后续 Windows 主线 CI 的监听测试,多次在等待删除通知时超时。Viva 的接口只返回变化路径或重扫信号。原测试对同一个路径连续执行创建、替换和删除,同一个父目录变化也能满足每个步骤的等待。Windows 2022 同一 runner 的实测中,原夹具 5 轮全部失败,修订后 20 轮全部通过。
改动 / Changes
创建、原子替换、删除分别使用专属路径和父目录。在监听注册前准备需要已存在的文件。
保留真实监听与 Core 投影,新增对同一文件连续替换和删除的一次合并通知的检查。保留原期限以及显式释放、上下文关闭和会话退出覆盖。
超时报告操作、路径、最后接收的序号及有限的其他事件批次。更新矩阵的原生监听验证描述。
两个 Windows 导航用例的测试数据复用 Core
lsp.documentUri。盘符路径生成正确的本机文件 URI,等待打开文档与目标列表时通过窗口唤醒确认,并报告具体失败步骤。撤销/重做染色回归中的增量视图和全量参考高亮器使用相同的分词选项,把完整 token 逐项比较。保留真实后台高亮、完整历史与 5 秒等待。生产分词仍使用 20 ms 单行预算。
不在本 PR 范围内 / Out of scope
Viva 的 Windows 根目录移动与替换问题见 #2374。
类型专属:fix
复现与根因
Windows 主线 CI 的四个子场景均在同一路径的删除等待超时。原测试无法识别先前操作尚未排空的路径通知。
两个 feat(desktop): support bidirectional implementation navigation and gutter icons #2391 导航用例把 Windows 盘符路径当作
url.URL.Path,形成file://C:/…。Go 解析后把C:当作主机,导航无法打开临时项目内的真实文件。Windows 2022 同机验证复现两个旧测试失败并验证修复。Windows CI 撤销第 8 步时缺少
package sample的末尾 token。通过本地 Go overlay 在中途暂停 30 ms,复现原测试的同一 token 差异。原用例对视图采用生产单行预算,参考按完整分词比对;分词超限时高亮器允许缓存部分 token。检查项
范围检查 / Scope checks
功能矩阵 / Feature matrix
插件归属 / Plugin ownership
UI 验证 / UI evidence
N/A:仅测试与验证记录。
统一日志系统 / Structured logging
N/A:新增内容只在测试断言失败时显示。
界面文案 / i18n
N/A:用户界面无变更。
逻辑归属 / Logic placement
N/A:生产逻辑原样保留,原生事件由 Viva 提供,Core 负责事件投影。
性能与内存 / Performance and memory
N/A:运行时路径无改动。
设置 / Settings
N/A:设置无变更。
插件契约 / Plugin contract
N/A:测试使用现有接口和真实 Core。
发行包只读与运行时资源 / Installed-package immutability
无用代码与重构 / Dead code and refactoring
N/A:只调整测试及相关证据。
验证 / Verification
desktop-go.sh test -race ./internal/pluginservice -run '^TestWorkspaceWatch' -count=20 -timeout=3mdesktop-go.sh test ./internal/pluginservice -count=1 -timeout=2m早期完整 CI 与基线的两个 Windows 导航失败均已在
db1107937修复。监听的原超时也可在 未含修复的主线日志 核对。本机无 Windows 虚拟机,Windows 验证通过 GitHub Windows runner 完成。整机手动交互未运行。本机 macOS 工作台全量在修复前后均可遇到既有构建工具版本探测超时,原版本与修订的隔离复跑通过。GitHub macOS 完整 CI 通过。
撤销/重做染色补充验证
最新提交
eef87b168(同步主线578113d906)的 Windows、macOS、Linux、远端服务器双架构测试、Desktop CI gate 和功能矩阵检查全部通过。 Desktop CI · 矩阵 CImacOS ARM64 故障注入对照,原测试出现相同 token 差异,修复后同一注入 10/10 轮通过。
macOS ARM64 三个 Undo/Redo 用例在低并行度与高频 GC 下通过 30 轮竞态检查。editorview、syntax、textmate 三个包的竞态检查通过。逐项计时 3 项通过,染色 100 ms,最长 540 ms。
同机 Apple M5 Undo/Redo 基准各取 6 个样本。100 KiB 中位数 60.5 → 51.8 µs、0 allocs/op。10 MiB 中位数 54.0 → 46.1 µs、18 allocs/op。生产路径相同,耗时差属于采样波动。
提交
c029922ae的 Windows 完整作业、Linux 和功能矩阵通过。Windows 日志确认 editorview、pluginservice、workbench 各分组和原生界面检查通过。 Desktop CI · 矩阵 CI同一提交的 macOS ARM64 托管作业连续三次在 runner 分配前被 GitHub 取消,检查注释报告容量不足。该提交的汇总门禁因此失败。 第 1 轮 · 第 2 轮 · 第 3 轮
本机 macOS 全量仍触发插件工具与构建可执行文件探测超时。此前全量失败用例在原测试夹具和候选夹具的隔离串行对照中均通过。
提交前确认 / Final checks
main。