Repository navigation
fix(debug): 在 hosted 适配器收到 initialize 后触发测试超时 - #2460
Merged
Merged
Conversation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
devin-ai-integration
Bot
requested review from
Mucheen and
xiaoyumuxi
as code owners
November 27, 2026 03:37
Contributor
Author
There was a problem hiding this comment.
🔍 Devin Review: 1 flag
Not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)
1lck
approved these changes
Nov 27, 2026
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
Closes #2368
PR 类型 / Type
改动说明 / What changes
背景 / Why
两项 hosted 调试超时测试用 300 ms 定时器模拟适配器没有应答。慢机上,超时可能早于适配器收到 DAP 初始化请求,使 TCP 用例无法可靠验证已连接的套接字被回收。
改动 / Changes
initialize请求时关闭通道一次,并继续读取而不应答。两项测试直接将这个通道交给已有的debugInitializeTrigger。正常响应的夹具继续使用同一套解析和应答逻辑。failed / StageTimeout及会话后台工作结束的断言。App.debugInitializeWindow和唯一的读取分支。生产计时仍由 Core 的初始化期限加上对应传输的发现窗口决定,watcher 继续随会话取消而停止。不在本 PR 范围内 / Out of scope
无。
类型专属:fix
复现与根因
在
bd971ad679执行git grep -nE 'debugInitializeWindow|debugInitializeTrigger' -- '*.go',可见两处测试都覆盖 300 ms,且在启动后直接等失败。两者在watchDebugInitialize都走time.AfterFunc,静默服务端的接收进度没有参与触发。预期应在已建立的真实回环连接上收到初始化请求后触发超时。TCP 和 hosted 两处赋值分别来自 #1799 和 #1945。无用户可观察缺陷,影响两平台共用的 Go 测试。修前核验检查项
git grep debugInitializeWindow -- '*.go'无命中。范围检查 / Scope checks
功能矩阵 / Feature matrix
debug-tcp-transport的双端证据路径和验证动作,两端原生验收状态保持 pending。插件归属 / Plugin ownership
UI 验证 / UI evidence
N/A:没有更改可见交互或布局。
统一日志系统 / Structured logging
N/A:生产日志路径保持原有语义,测试验证既有启动终态记录。
界面文案 / i18n
N/A:未改动文案。
逻辑归属 / Logic placement
N/A:生产继续采用 Core 策略,Go 只负责计时。
性能与内存 / Performance and memory
N/A:没有增加运行时依赖、定时器、轮询或缓存。
设置 / Settings
N/A:未改动设置。
插件契约 / Plugin contract
N/A:未改动插件协议或宿主方法。
发行包与资源 / Bundle and resources
N/A:未改动运行时资源。
无用代码与重构 / Dead code and refactoring
验证 / Verification
Linux amd64,桌面模块工具链 Go 1.27.4。下表中的测试过滤器为
^TestDebug(TCPAdapterThatNeverInitializesTimesOut|HostedAdapterThatNeverAnswersIsRecordedAsATimeout)$。run-go-tests-with-timing.mjs --report .artifacts/test-stability/linux-debug-timeouts.json -- ./scripts/desktop/desktop-go.sh test -p 1 -count=1 -json -timeout 3m -run "$filter" ./internal/workbench.artifacts/test-stability/index.html与 JUnit 中的逐项记录./scripts/desktop/desktop-go.sh test -race -count=20 -run "$filter" ./internal/workbench./scripts/desktop/desktop-go.sh test -count=1 -timeout=20m ./...verify-platform-feature-matrix-change.sh origin/main HEAD、verify-platform-feature-matrix.shverify-runtime-bundle-immutability.sh、verify-app-language-localization.mjs、generate-i18n.mjs --check、git diff --check origin/main...HEADverify-test-stability.sh、verify-test-stability.sh --base origin/main在同一 Linux 环境用 Go overlay 恢复全部改动的 Go 文件到基线版本。修前 TCP 为 340 ms、hosted 为 440 ms,功能断言均通过。全量首轮的隐藏目录用例
TestHiddenFoldersListTheTreeAgainOnlyWhenTheyChange报the same names in another case listed the tree again: 3 to 4;基线重复 500 次亦出现相同报错(共 24 次用例失败)。本机未运行 macOS 和 Windows 原生测试,由 ready 后的 GitHub Actions 检查。
提交前确认 / Final checks
main创建分支,目标为main。Link to Devin session: https://app.devin.ai/sessions/7a09231b73e341d7b7a31123c3e5d143
Open in Devin Desktop: https://app.devin.ai/desktop/session/7a09231b73e341d7b7a31123c3e5d143?variant=devin
Requested by: @1lck