Skip to content

[Bug] TestProjectTreeDirectoryReadCancelsWhenProjectCloses intermittently times out on macOS CI #2221

Closed

Description

@1lck

Platform / 平台

macOS

Area / 模块

Test / 测试

Lithe version / Lithe 版本

0119f41 (also observed earlier at 761e6f8 on origin/main)

Priority / 优先级

P1 / 尽快处理:使用体验大幅下降,但通常仍可继续使用

OS and architecture / 操作系统与架构

macOS 26 ARM64 (GitHub Actions macos-26 runner)

Environment / 环境信息

Go + Lithe-core-rust (scripts/desktop/check.sh, ./internal/workbench package suite)

Steps to reproduce / 复现步骤

  1. Run Desktop CI (Vet and test on macOS on macos-26) running ./scripts/desktop/check.sh.
  2. Reach TestProjectTreeDirectoryReadCancelsWhenProjectCloses (desktop/internal/workbench/filetree_test.go:101-132).
  3. Observe intermittent failures in openTree -> closeTree -> listTree sequence.

Expected behavior / 预期行为

TestProjectTreeDirectoryReadCancelsWhenProjectCloses arms cancelledTreeListingKernel, starts ListDirectories, cancels it when the project closes, and passes deterministically on every macOS CI run.

Actual behavior / 实际行为

On macos-26 runners running the full internal/workbench suite, the test intermittently fails with:
filetree_test.go:119: directory read did not start (after waiting 8 seconds).

Observed CI runs:

Likely root cause from inspection:

  • h.openTree (desktop/internal/workbench/filetree_actions_test.go:39) awaits only p.tree.root != nil && p.tree.root.listed rather than !p.tree.reading / watch settle.
  • On macOS (treeUsesRecursiveWatch() == true), initial recursive FSEvents ready/resync events can trigger resyncTreeListings around closeTree(p) / listTree(p, "") (filetree_watch.go:94-106), leaving p.tree.reading == true so the subsequent pumpTreeListings skips calling kernel.ListDirectories.
  • Calling h.app.closeTree(p) / h.app.listTree(p, "") directly outside h.app.post can also race with window thread tree listing state.

Logs or diagnostic output / 日志或诊断输出

--- FAIL: TestProjectTreeDirectoryReadCancelsWhenProjectCloses (8.11s)
    filetree_test.go:119: directory read did not start
FAIL
FAIL	github.com/1lck/Lithe-IDEA/desktop/internal/workbench	398.191s

Screenshots or recordings / 截图或录屏

N/A

Checklist / 提交前检查

  • I searched existing issues for duplicates. / 我已搜索现有 Issue,确认没有重复报告。
  • I removed secrets and personal data from the report. / 我已从报告中移除敏感信息和个人数据。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugreview: high

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions