[Bug] macOS 整包测试偶发无法观察到 tcpAnnounced 适配器的 disconnect

Ouverte
#1,981 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
22/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
Active
Stack technique
go
Domaine
testing

Piste de recherche

Start at the failing assertion in desktop/internal/workbench/debug_announced_test.go around line 264 in TestDebugAnnouncedAdapterBreakpointPauseContinueStop, then read releaseDebugSession, drainHostedSession, StopAfterRequest and the fixture serveFixtureAdapter to see the order in which the DAP disconnect is flushed, the process exits and the watch socket is written. Reproduce with scripts/desktop/desktop-go.sh test ./internal/workbench -run '^TestDebugAnnouncedAdapterBreakpointPauseContinueStop$' -count=20 -race on macOS ARM64 and add timing/ordering evidence at those boundaries. Done means the case fails only on a genuinely lost disconnect, with no removed assertions, inflated timeouts or blanket retries.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

area:test bug P2 platform:macos review: high
Platform / 平台

macOS

Area / 模块

Test / 测试

Lithe version / Lithe 版本

源码构建 4032c5ca0fad2d2c1986ead37d719ec1f9f0502e,Desktop CI 43711357866,第 1 次运行;desktop/viva.toml 为 0.7.0。本报告是 CI 无头测试失败,不是用户已安装程序的故障报告。

Priority / 优先级

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

OS and architecture / 操作系统与架构

GitHub 托管 macos-26-arm64;macOS 26.7.2(25G332),ARM64,runner image 20261102.0473.1。

Environment / 环境信息
  • 失败环境来自公开 CI 作业日志,不使用本机系统版本替代;运行的是 Go test 的无头工作台和自启动的合成调试适配器,不是 DMG/安装版。
  • 构建基线:Go 工具链来自 desktop/go.mod(go1.27.3);Rust 1.100.0;Viva fork 3a274c3800ef;Lithe-core-rust 9425469bdaa5a8195d9cdf5e9f440165c9e79810。源码可在该 commit 的 go.mod 和构建脚本核对。
  • 合成插件 dev.lithe.test.debug-announced;适配器是复制的工作台测试二进制,经本机 loopback TCP 执行 DAP。没有真实插件、JDK、Maven、LLDB 或用户项目参与。
  • 工作区由 fixtureWorkspace/announcedWorkspace 在临时目录创建,包含合成调试源文件和 announce.marker;用户配置和真实项目规模不适用。没有修改系统权限或安全策略。
  • 测试主动加载 Core 的停止宽限设置,等待会话 paused、Continue、Pause,再点击 Stop,等待 cleanupDone 后读取独立 watch socket 的退出报告。
  • CI 当时 CPU、内存和调度负载未采集;不能据此断言机器太慢或调度就是根因。GPU、屏幕、输入法与此无头进程协议断言无关。
  • 同一份产品代码在 8a32a2227 的完整三系统 CI 43709421893 通过。4032c5ca0 只改发布校验脚本、脚本测试与 Note,没有改 Go/Core 调试实现。
  • 在 macOS ARM64 本机用同一 checkout 单独连续运行该测试 20 次,全通过(包用时 12.947s);本机不是原失败 runner,这不是稳定复现。
Steps to reproduce / 复现步骤
  1. 检出 4032c5ca0,在上述 macOS runner 中运行 Desktop CI 的 scripts/desktop/desktop-go.sh test ./... 整包测试。
  2. TestDebugAnnouncedAdapterBreakpointPauseContinueStop 创建合成 tcpAnnounced 适配器,走启动、断点暂停、继续、再次暂停和停止。
  3. Stop 后等待会话销毁和 cleanupDone,再读取独立 watch socket。
  4. 第 1 次 CI 出现下面的失败;当前尚无稳定最小复现。单独 scripts/desktop/desktop-go.sh test ./internal/workbench -run '^TestDebugAnnouncedAdapterBreakpointPauseContinueStop$' -count=20 -timeout=120s 全通过;失败任务单独重跑后,同一 commit 的 Desktop CI 第 2 次运行全部通过;没有修改源码或放宽断言。
Expected behavior / 预期行为

适配器收到 disconnect 后退出,并在独立 watch socket 报告 disconnected;用例应通过明确的协议/生命周期同步验证,而不依赖调度巧合。真正的 disconnect 丢失必须继续失败,不能删除断言、放大超时或无条件重试来掩盖。

Actual behavior / 实际行为

整包工作台测试 303.173s 后,该用例在 0.19s 内失败:适配器进程退出,watch 报告为空。尚未区分“测试观测/共享停止设置竞争”与“真实停止链路偶发丢失 disconnect”;不能宣称这是纯测试问题或产品已经修复。当前确认的影响是 main CI 偶发失败,真实用户调试行为的影响尚未复现。

复跑结果:Desktop CI 43711357866 第 2 次运行完整 macOS 检查通过,Linux、Windows、脚本、固定版本及汇总门禁也全部通过。根因仍待定位,保留本报告跟踪偶发失败。

初步检查:releaseDebugSession 会取消会话、drainHostedSession 刷出 DAP disconnect、再 StopAfterRequest 等待进程;夹具 serveFixtureAdapter 返回后才向 watch 写 disconnected。需要在这些边界增加确定性证据来定位,不能只以最后的空字符串推断原因。

查重已搜索所有状态的 adapter process ended、BreakpointPauseContinueStop;没有同一症状的报告。相关 #1962 是另一个用例的 300ms 启动超时导致进程尚未连上 watch,本项已启动并完成调试会话,不能直接认定同因。

Logs or diagnostic output / 日志或诊断输出
2026-11-15T12:04:00Z --- FAIL: TestDebugAnnouncedAdapterBreakpointPauseContinueStop (0.19s)
    debug_announced_test.go:264: the adapter process ended without its disconnect (reported "")
FAIL github.com/1lck/Lithe-IDEA/desktop/internal/workbench 303.173s

来源:失败 macOS 作业。只摘录公开用例与断言,没有上传用户目录、设备标识、凭据或原始环境转储。

Screenshots or recordings / 截图或录屏

不适用:这是无头协议/进程生命周期测试的断言失败,没有相关可见界面;上面的公开 CI 日志是原始症状证据。

Checklist / 提交前检查
  • I searched existing issues for duplicates. / 我已搜索现有 Issue,确认没有重复报告。
  • I removed secrets and personal data from the report. / 我已从报告中移除敏感信息和个人数据。
Langage dominant
TypeScript
Étoiles
1.8k
Forks
151
Merge moyen
3 h 48 min
PR mergées (30 j)
571

Préparer son environnement

Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de 1lck/Lithe-IDEA

Toutes les issues de 1lck/Lithe-IDEA

Issues similaires

Plus d'issues TypeScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.