[Bug] Windows 项目树展开上限测试在等待树空闲时超时

Open
#2,433 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
go
Domain
desktop, testing

Research direction

Start with internal/workbench/filetree_actions_test.go:235 and the TestProjectTreeExpandAllStopsAtItsLimit test; it times out while waiting for treeIdle(p) after the expansion limit assertions pass. Compare the test and tree reading or pending state with the main overlay, where the same failure occurs, then capture the pending directory and watcher state during the wait. Done means identifying why the tree does not reach idle or supplying a minimal diagnostic that pinpoints the unfinished read or synchronization boundary.

Written by the indexing model from the issue text.

Description

review: medium
Platform / 平台

Windows

Area / 模块

Test / 测试

Lithe version / Lithe 版本

源码测试构建:测试二进制启动时 checkout HEAD 为 4225299b1073f39e87ddc36caa20fd6da98bb0fb,含 #2425 的工作台测试修复。filetree_actions_test.go 相对 main 349f389ba027bedd003fbda2faf0e7f64d7e7f10 无差异;main 工作台源代码 overlay 同样失败。这是源码测试失败,不是已发布应用的运行报告。

Priority / 优先级

P2 / 后续考虑:目前不着急,可安排到后续版本

OS and architecture / 操作系统与架构

Windows 11 Pro,build 26300,原生 amd64 物理机,无架构仿真。

Environment / 环境信息
  • 发生于 2026-11-26(Asia/Shanghai)的本地 Windows 工作台分段测试。Go 1.27.4、GNU Rust 1.100.0、Git 2.56.1.windows.1;CPU Intel Core Ultra 5 125H,32 GiB 内存。
  • 默认固定 Core e8927412b6324636f2636b58c521758451d97fc4、Viva 448b0553faf8,无本地依赖覆盖。通过仓库的 Git Bash / desktop-go 构建与测试入口执行。
  • 用例在本地 t.TempDir() 下创建 treeExpandAllLimit + 2 个平级目录,每个目录有一个 f.txt,使用合成工作台 harness 和真实目录读取/监听边界。没有业务项目、真实插件或外部网络依赖。
  • main 对照通过 Go overlay 将本分支相对基线有差异的 20 个 Go 源文件(含工作台和 i18n 生成文件)映射回 349f389ba,本次新增文件替换为空的 package workbench,使用相同固定依赖;这是该包的源码对照,不宣称重新验证了整个 main 仓库。
  • 失败时没有采集 CPU/磁盘负载、文件监听事件序列及待处理目录快照;不能据此判断是负载、监听事件、目录读取流程还是测试同步问题。临时目录实际路径及完整环境变量未公开。
Steps to reproduce / 复现步骤
  1. 在 Windows 上准备上述源码和默认固定依赖,按仓库构建入口运行工作台测试。本轮实际由工作台分段测试触发。
  2. 用例可用 scripts/desktop/desktop-go.sh test -count=1 ./internal/workbench -run '^TestProjectTreeExpandAllStopsAtItsLimit$' 筛选;本报告没有额外执行隔离复跑,不能保证孤立运行必现。
  3. 用例创建 treeExpandAllLimit + 2 个目录并打开项目树,调用 expandProjectTree,验证停止展开、上限提示及展开目录数。
  4. 在 filetree_actions_test.go:235 等待 treeIdle(p),即 !p.tree.reading && len(p.tree.pending) == 0。
Expected behavior / 预期行为

展开达到上限后,已经请求的目录读取应在有界时间内完成,项目树进入空闲状态,测试稳定结束。若流程不能完成,应提供足以定位未完成读取或测试同步边界的最小诊断。

Actual behavior / 实际行为

用例已通过停止展开、提示文本和目录数量的断言,随后在最后等待树空闲的步骤达到 awaitDocumentState 的期限,报告 document watcher did not deliver the expected state before the deadline。本轮测试整体耗时 9.24s;main 源码 overlay 中同一行、同一错误再次失败,整体耗时 9.45s。这些是整项测试耗时,不能当作纯等待时间。

原因尚未确定。日志只证明等待期间未观察到预期的树空闲状态,不能据此断定生产项目树永久挂死,也不能归因于 #2425 的 taskGroup 或新的等待 helper。main 对照同失败表明该症状在本次修复之外也存在。

查重时已阅读 #2379(另一文档关闭用例的同类等待错误)和已关闭的 #2221(macOS 项目关闭取消目录读取的不同等待位置);它们没有记录本用例的 Windows 展开上限后空闲等待失败。错误文案来自共用 helper,本身不足以证明同一根因;后续诊断若确认关联,可再合并跟踪。

Logs or diagnostic output / 日志或诊断输出
# 当前测试构建(启动时 checkout HEAD 4225299b1)
=== RUN   TestProjectTreeExpandAllStopsAtItsLimit
    filetree_actions_test.go:235: document watcher did not deliver the expected state before the deadline
--- FAIL: TestProjectTreeExpandAllStopsAtItsLimit (9.24s)

# main 349f389ba 工作台源码 overlay,相同依赖
=== RUN   TestProjectTreeExpandAllStopsAtItsLimit
    filetree_actions_test.go:235: document watcher did not deliver the expected state before the deadline
--- FAIL: TestProjectTreeExpandAllStopsAtItsLimit (9.45s)
Screenshots or recordings / 截图或录屏

不适用:本轮为命令行驱动的工作台测试,无真实用户界面操作录屏;失败步骤和日志已列出。

Checklist / 提交前检查
  • I searched existing issues for duplicates. / 我已搜索现有 Issue,确认没有重复报告。
  • I removed secrets and personal data from the report. / 我已从报告中移除敏感信息和个人数据。
Dominant language
TypeScript
Stars
1.8k
Forks
151
Avg merge
3h 48m
Merged PRs (30d)
571

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from 1lck/Lithe-IDEA

All issues in 1lck/Lithe-IDEA

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.