Repository navigation
Conversation
- 每轮 attempt 开始时同时重置 lastExitCode 与 lastDiagnosis,上一轮的 UNKNOWN/崩溃分类不再短路本轮日志。 - 本轮等待循环里写入的 45 秒提前诊断仍优先用于 fatal 结论。 - 新增 attempt-diagnosis-budget-test.js:假时钟 + 假进程 + 依赖桩走真实 start() 决策路径;基线 RED → 修复后 GREEN。 - 不改变重试次数、GPU 策略与用户数据逻辑。
- doctor: BOOT_TIMEOUT_MS 单点定义(auto 240000 / off 600000)与 bootTimeoutFor(plan)。 - planVariants 的两个 off 回退档按最终 accel 重算预算,原本更长的有效预算保留。 - emulator 等待循环改为 doctor.bootTimeoutFor(plan),覆盖驱动 forceTcg 把 auto 改 off 的入口。 - 测试覆盖 300 秒就绪不截止、10 秒退出立即失败、wipe=false/snapshot 原合同;接入 npm test。
- child_process 的执行入口在 require doctor/emulator 之前替换:先装桩再加载,避免解构捕获真实函数。 - GPU 发现给固定夹具;其余任何外部调用记为 blocked,并由用例包装器判失败(即使目标自己 catch)。 - Runtime 成功路径的 checkNetwork 提供 fixture 桩,不联系 PATH 上的 adb / 外部 HTTP。 - 反向控制证明被 catch 的外部调用不会被悄悄放过;测试结束恢复全局钩子与虚拟计时器。 - 收窄误导性用例名:初始 profile 即 off,不经过 auto→off 回退。产品代码不变。
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.
Problem
A failed emulator attempt can leave
lastDiagnosisset for the next attempt. If the next process exits after startup settling, its fatal path can reuse the previousUNKNOWNor crash classification even when the current log identifies a different failure.Software emulation can also inherit the hardware startup budget. The two
accel=offfallback plans inherited 240 seconds, and a driver applyingforceTcgchanged the effective acceleration without updating that budget. A simulated boot ready at 300 seconds therefore timed out despite the existing 600-second software-emulation policy.Changes
accel, including driver-forced TCG. Software emulation receives at least 600 seconds; hardware defaults stay at 240 seconds, and an existing longer budget is preserved.Validation
Reviewed head:
519acfc98e886e3fed370dbdacbf50021f251687.node test/attempt-diagnosis-budget-test.jspassed 10/10, native exit 0, in an independent detached checkout of this head. Coverage includes attempt history, same-attempt fatal diagnoses, budget preservation, simulated 300-second readiness, 10-second exits and the isolation negative control.Runtime.ensurethroughEmulatorEngine.start, including process settling and the exit callback. Baselinea4d4a23cdd20d8943703ae172a0c8734ca23b097passed 15/17 checks, failing the two intended diagnosis assertions; product candidate9abeb9e676f2dca27cbf97724529b6f2a6b32f5dpassed 17/17, native exit 0.Scope
These checks use a virtual clock and synthetic emulator processes. External GPU discovery, ADB and network interactions use fixtures or are blocked. The focused suite uses private TEMP files; the independent Runtime probe uses an in-memory target filesystem.
The underlying user-reported crash in #60 remains unresolved by this change. This PR improves diagnosis accuracy and startup-budget consistency; it does not establish real Android boot success or hardware compatibility. No issue is automatically closed, and no user-data reset or wipe behavior is added.