Repository navigation
Conversation
Contributor
总体结论:可以合并宝宝,这版没有把 恢复只在确认离线的已知错误上进行;启动中不重复 launch,取消继续向外传,任务失败记录和原有收尾仍保留。跳过启动前全局强杀、失败后保留归属不明的实例,是这里明确的安全取舍。 不过,这不等于真实 MuMu 的 —— 不乱重试,也不乱关实例的 dot酱 🐾 |
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.
摘要
-503 mainnx connect failed时,原流程直接抛错;现在解析 JSONerrcode,关联 Windows 退出码4294966793 → -503,并保留未知错误的失败语义。-503最多尝试三轮、间隔两秒,共享MaxWaitTime;已在线或正在启动时不重复发送 launch,无法可信判断状态时停止恢复。测试与验证
环境与提交:Linux 6.18、CPython 3.12.13、
uv sync --locked --group dev;提交7e1573925e64253aa81147b67ecdbcc2378e6e75,基于最新 devad3de270ef906019d863a09d399db5a667165b81。相关回归(提交后复跑):
82 passed。覆盖正常/已运行/启动中、暂时及持续 -503、JSON 报错但退出码为 0、无符号退出码、命令报错但实例已启动、三轮及两秒间隔、共享超时、不同实例隔离、同实例并发、取消/超时释放锁、真实 MAA 入口停止外层重跑,以及调度终态、配置锁释放和后续脚本继续。
全量:
uv run --no-sync python -m pytest tests -q→ 2066 passed, 4 failed, 43 skipped, 17 subtests passed。四项失败的基线对照见下文;没有新增失败,未删断言或增加 skip/xfail。额外最小核心回归:
uv run --no-sync python -m pytest tests/task/test_maafw_core.py -q→ 12 passed。静态检查:
uv run --no-sync ruff format --check .、全部改动 Python 文件的ruff check、uv lock --check、git diff --check、python scripts/changelog.py check --pr-base upstream/dev --pr-kind normal均通过。mypy --config-file mypy-platform.ini --platform win32/linux/darwin分别通过,均检查 23 个源文件。测试提交:新增
tests/tools/test_mumu_launch_recovery.py、tests/task/test_mumu_startup_failure.py;调整tests/tools/test_mumu_foreground_budget.py的真实初始化及状态夹具,保留原有前台检测预算断言。新增的等待锁超时场景在修正前实际尝试了control -v 0 shutdown而失败,修正后不关闭该实例并通过。版本记录:仅新增
changelog.d/mumu-launch-recovery.fix.md一条碎片;res/version.json、项目版本号及已发布历史记录未改。四项既有进程测试失败的复现与诊断
在隔离、未修改的最新 dev
ad3de270ef906019d863a09d399db5a667165b81上,运行以下同名用例,结果 4 failed(17.85 秒):service.wait(timeout=5)抛psutil.TimeoutExpiredProcessCleanupUnconfirmed: 无法确认子进程树已停止,不能释放更新目录只读检查这些测试自己记录的 PID:四个残留均为
status=zombie, ppid=1。前两项卡在测试清理等待,后两项的退出确认将未被容器 PID 1 回收的僵尸子进程保留为未确认状态;本次没有改动这些进程管理逻辑。修复树与基线的以下文件逐字节相同:
app/utils/common/process/runner.py:SHA256d32636941b37dcd062ffd48afff485bdfa8cffa831315fca225101400a07350ctests/platform/test_process_runner_env.py:SHA256dc6d4c6660f9d0fa73e630ea88679f0ed8eb0a238b16038e4960e936bdf25d56没有修改生产代码、测试断言或 skip 来规避这些失败。CI 的 Windows/Ubuntu 结果需另行观察,不能由此推断一定通过。
已知限制与待验证范围
-503根因未确认,云端没有真实 MuMu,真实故障未复现。Mock 证明的是 AUTO-MAS 对给定响应的识别、有限恢复和安全退出。cd frontend; yarn e2e:real,产出截图、HTML 报告和real-e2e-summary.json,这条尚无实际执行证据。CI(同一提交)
提交
7e1573925e64253aa81147b67ecdbcc2378e6e75的 8 项 PR 检查均已完成并通过:这不改变上面的本地容器四项既有失败记录,也不代表已完成 MuMu 实机验证;PR 保持 Draft,未合并。