[Feature] 统一 hosted 调试初始化超时测试到确定性触发通道并清理 debugInitializeWindow
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Start with watchDebugInitialize in desktop/internal/workbench/debug_start.go and find where App.debugInitializeTrigger is read and closed in app.go. Move TestDebugTCPAdapterThatNeverInitializesTimesOut in debug_tcp_test.go and TestDebugHostedAdapterThatNeverAnswersIsRecordedAsATimeout in debug_adapter_start_test.go onto that trigger, then grep the repo for other debugInitializeWindow uses. Done when both tests pass without the 300ms timer and the field is removed if nothing else reads it.
Written by the indexing model from the issue text.
Description
Problem to solve / 要解决的问题
desktop/internal/workbench 中仍有两项既有的 hosted 调试初始化超时测试依赖固定实时定时器 h.app.debugInitializeWindow = 300 * time.Millisecond:
desktop/internal/workbench/debug_tcp_test.go:TestDebugTCPAdapterThatNeverInitializesTimesOutdesktop/internal/workbench/debug_adapter_start_test.go:TestDebugHostedAdapterThatNeverAnswersIsRecordedAsATimeout
两处通过 300ms 真实计时器触发 watchDebugInitialize(desktop/internal/workbench/debug_start.go),在慢速 CI 机器或竞态检测下每次测试至少等待 300ms,并且存在 beginDebug / serveHostedAdapter 建连与 300ms 定时器竞争的风险,同时使得 App.debugInitializeWindow(desktop/internal/workbench/app.go)继续作为第二套测试超时控制机制与 App.debugInitializeTrigger 并存。
Proposed solution / 建议方案
将 TestDebugTCPAdapterThatNeverInitializesTimesOut 和 TestDebugHostedAdapterThatNeverAnswersIsRecordedAsATimeout 统一迁移到确定性触发通道 App.debugInitializeTrigger(在确认 serveHostedAdapter 收到连接且会话进入初始化后关闭触发通道),并随后检查全仓库是否仍有其他 debugInitializeWindow 调用方;若无剩余调用方,一并清理 App.debugInitializeWindow 字段及其读取分支。
Target platform / 目标平台
Cross-platform / 跨平台
Area / 模块
Debug / 调试
Priority / 优先级
P2 / 后续考虑:目前不着急,可安排到后续版本
Alternatives considered / 已考虑的替代方案
继续保持两项 hosted 超时测试使用 debugInitializeWindow = 300 * time.Millisecond,仅在发生慢机超时误报时临时放大窗口;但这不符合 write-stable-tests 的确定性同步原则,也会保留两套测试超时控制字段。
Additional context / 补充信息
- 相关代码位置:
desktop/internal/workbench/app.go:App.debugInitializeWindow、App.debugInitializeTriggerdesktop/internal/workbench/debug_start.go:watchDebugInitializedesktop/internal/workbench/debug_tcp_test.go:TestDebugTCPAdapterThatNeverInitializesTimesOutdesktop/internal/workbench/debug_adapter_start_test.go:TestDebugHostedAdapterThatNeverAnswersIsRecordedAsATimeout
- 来源:#1962 / PR #2341 审查时按
develop-lithe第九节记录既有的独立可重构项,未在同一 PR 中顺手修改无关测试。
Checklist / 提交前检查
- I searched existing issues for duplicates. / 我已搜索现有 Issue,确认没有重复建议。
- 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from 1lck/Lithe-IDEA
-
review: medium
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
1lck/Lithe-IDEA#2432 ·
Maintainers usually reply within 1 day
-
review: medium
Difficulty 1/5 Under an hour Newbie friendliness 82/100
1lck/Lithe-IDEA#2431 ·
Maintainers usually reply within 1 day
-
refactor review: high
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
1lck/Lithe-IDEA#2376 ·
Maintainers usually reply within 1 day
-
area:ui enhancement P2 platform:cross-platform refactor review: high
Difficulty 1/5 Under an hour Newbie friendliness 84/100
1lck/Lithe-IDEA#2365 ·
Maintainers usually reply within 1 day
-
review: medium
Difficulty 3/5 1-2 days Newbie friendliness 57/100
1lck/Lithe-IDEA#2434 ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
rel: fix
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Deltares/fews-web-oc#2400 ·
Maintainers usually reply within 1 day
-
Command bar: Tab-to-search on claude.ai falls back to Google site: search instead of opening a prompt on ClaudePossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
ardia-browser/ardia#4426 ·
Maintainers usually reply within 1 day
-
Bug report: isValidISODateDashOnly accepts text before or after the date-timePossibly taken @bardrop claimed this today. Open
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
pnp/cli-microsoft365#7713 ·
Maintainers usually reply within 1 day
-
Diagram: Journey Type: Bug / Error
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
mermaid-js/mermaid-v13#1293 ·
Maintainers usually reply within 1 day