Skip to content

[Bug] 桌面测试 TestTerminalMenuSelectsAllAndCopies 在 preview 上稳定失败:终端面板没有显示 #1907

Closed

Description

@1lck

Platform / 平台

macOS

Area / 模块

Terminal / 终端

Lithe version / Lithe 版本

preview 7c036b3(源码构建,桌面测试;未在发行版上运行)

Priority / 优先级

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

OS and architecture / 操作系统与架构

macOS 26.6.2, arm64(Apple M4;测试以 GOARCH=arm64 构建)

Environment / 环境信息

  • 运行方式:scripts/desktop/desktop-go.sh test ./internal/workbench/ -run TestTerminalMenuSelectsAllAndCopies -count=2
  • Go:go1.27.3
  • Core:固定修订 2c1fed18906528c6c499ea95e5ca413af6c8c286 和 Lithe-core-rust main a320d16 两种都试过,结果相同
  • 已确认:不是终端进程起不来。测试里等 shell 输出 menu-marker 的那一步通过了,失败发生在之后检查终端面板是否显示的地方
  • 未采集:其他 Mac、Windows(该测试在 Windows 上跳过)

Steps to reproduce / 复现步骤

  1. 检出 preview 7c036b3b8
  2. 运行 scripts/desktop/desktop-go.sh test ./internal/workbench/ -run TestTerminalMenuSelectsAllAndCopies -count=2

Expected behavior / 预期行为

测试通过:终端面板显示出来,右键菜单的“全选”选中 shell 输出,“复制”写入剪贴板。

Actual behavior / 实际行为

每次都失败(2/2、5/5):context_menu_test.go:60: the terminal is not shown。也就是 h.app.reduceChrome(core.SetChromeOpen(itemTerminal, true)) 加 h.settle() 之后,终端视图的 term.hit 仍为零。

推测(待确认):该测试今天在 #1894 中改过,此前 #1849 调整过工作台布局;可能是终端面板在测试窗口尺寸下没有被布局出来,或打开终端的方式变了。合并到 preview 的 CI 只做打包、不跑这组测试,所以没有被发现。

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

--- FAIL: TestTerminalMenuSelectsAllAndCopies (0.10s)
    context_menu_test.go:60: the terminal is not shown
FAIL
FAIL	github.com/1lck/Lithe-IDEA/desktop/internal/workbench	1.630s

Screenshots or recordings / 截图或录屏

无:无头测试,没有窗口可截图。

Checklist / 提交前检查

  • I searched existing issues for duplicates. / 我已搜索现有 Issue,确认没有重复报告。
  • I removed secrets and personal data from the report. / 我已从报告中移除敏感信息和个人数据。

Activity

  1. added
    review: high
    on Nov 14, 2026
  2. added a commit that references this issue on Nov 14, 2026
    5bf0a65
  3. 1lck commented on Nov 14, 2026

    @1lck
    OwnerAuthor

    已通过 #1917 squash 合入 preview,合并提交:5bf0a65c3a87f6a2ff360d252591bbdd821f2e3b。

    根因是测试直接调用 reduceChrome 后未请求重绘,Driver.Pump 只消费已有 wake;shell 输出偶尔掩盖缺失刷新。修复先消费输出帧,再点击真实终端侧栏按钮。修复前连续 5 次失败,修复后连续 20 次通过,相邻菜单用例和竞态检查通过;重放最新 preview 后再次连续 5 次通过。

    同步测试约束笔记和宿主终端功能矩阵的真实测试证据,原生与 Windows 验收状态仍为 pending。按维护者明确要求跳过 CI、压缩提交合并,本次关闭不宣称 CI 已运行或通过。

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

    review: high

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions