merge(chv-muse-round12): 合入 round-11 修复轮 HEAD 50cae2a (RETEST6 全绿)
按 hunk 合入,不整文件覆盖。冲突 3 处:
- chv-guest/build.sh:取 P4 的 copy-in(cdp-broker/guard/blocklist/
chv-memory)+ cdp-broker service/enable 三件;取 R11 的 git
config(去掉 credential.helper store,层 5);tmpfiles 两边
并存(/run/chv/ask-queue + /run/chv-browser)。
- chv-guest/chv-browser.py:P4 架构保留(CDP broker 客户端 +
guard 模块);取 R11 两处仍适用的运行期修复:BROWSER_SOCK
移进 /run/chv-browser(缺陷 4,合入后的 broker 已指该路径)
与 handle_request 认 op=browser/action 透传;R11 的直连
Playwright 代码(validate_url/truncate_aria/_load_playwright/
_page snapshot)由 P4 取代,不带回。
- cloud/tests/test_chv_muse_p2.py:truncate 三测取 P4 的
GUARD.truncate_a11y(dict 树);FakeCdpBroker 取 P4 版,删
R11 的 FakePage 系列;干跑夹具取 R11 的 _fixture 调用,并
给 _fixture 补 P4 四件(否则合入后 build.sh fail-fast)。
合入内移植(R11 修复在 P4 里移了位置,不移植即静默丢失):
- chv-guest/chv-cdp-broker.py:_load_playwright 返回
sync_playwright()(原 R11 在 chv-browser.py 修过的同形
bug);回归测试由 test_p2 移植到 test_chv_muse_p4.py。
- test_chv_muse_p2.py:HOST 由模块级 eager 改懒加载(_host()):
host.py 顶层 import queue 会把 stdlib queue 缓进 sys.modules,
使同进程后加载的 test_queue_sandbox 取不到 cloud/queue.py
遮蔽而 ImportError(全量唯一失败)。
未移植(见报告):R11 的 Page.aria_snapshot() 纠正未进
chv-cdp-broker.py(仍调 accessibility.snapshot(),且 guard
的 dict 树 API 须配套改,属 P4 返工,不在本轮合入做)。
全量 cloud 套件:2522 tests OK (skipped=10),基线 a6f9597
为 2474 OK (skipped=12);+48 来自 R11 新增测试(p2 +36、
p3 +7、closeup +3、gaps +1、p4 +1 移植)。
This commit is contained in:
commit
9da74c2a78
24 files changed
+1949
-217
No files matched your search
@@ -224,6 +224,42 @@ class WakeFailureTest(CloseupCase):
|
||||
with self.assertRaises(ChvFailure) as ctx:
|
||||
ex.wake_vm(self._task())
|
||||
self.assertEqual(ctx.exception.kind, "vm_boot_failed")
|
||||
|
||||
def test_wake_vm_boot_failed_records_body(self):
|
||||
# part 4:vm.boot 500 只留 status 即无法定位——body 要进
|
||||
# 失败消息(截断后,见 _truncate_api_body)。
|
||||
def api(socket_path, method, path, payload=None):
|
||||
if method == "PUT" and path == "/vm.boot":
|
||||
return (500, {"error": "boom-detail-500"})
|
||||
return (200, {})
|
||||
ex = self.make_exec(api_client=api)
|
||||
with self.assertRaises(ChvFailure) as ctx:
|
||||
ex.wake_vm(self._task())
|
||||
self.assertEqual(ctx.exception.kind, "vm_boot_failed")
|
||||
self.assertIn("boom-detail-500", str(ctx.exception))
|
||||
self.assertIn("status=500", str(ctx.exception))
|
||||
|
||||
def test_wake_vm_create_failed_records_body(self):
|
||||
def api(socket_path, method, path, payload=None):
|
||||
if method == "PUT" and path == "/vm.create":
|
||||
return (500, "No bootitem named default")
|
||||
return (200, {})
|
||||
ex = self.make_exec(api_client=api)
|
||||
with self.assertRaises(ChvFailure) as ctx:
|
||||
ex.wake_vm(self._task())
|
||||
self.assertEqual(ctx.exception.kind, "vm_create_failed")
|
||||
self.assertIn("No bootitem named default", str(ctx.exception))
|
||||
|
||||
def test_wake_vm_boot_failed_body_truncated(self):
|
||||
def api(socket_path, method, path, payload=None):
|
||||
if method == "PUT" and path == "/vm.boot":
|
||||
return (500, {"error": "x" * 2000})
|
||||
return (200, {})
|
||||
ex = self.make_exec(api_client=api)
|
||||
with self.assertRaises(ChvFailure) as ctx:
|
||||
ex.wake_vm(self._task())
|
||||
self.assertIn("已截断", str(ctx.exception))
|
||||
self.assertLess(len(str(ctx.exception)), 1200)
|
||||
self.assertIn("vm_failed", self._audit_events())
|
||||
self.assertEqual(ex._vms, {})
|
||||
|
||||
|
||||
Reference in new issue
Block a user