Repository navigation
fix(test): align foreign-host machine_id fixture (#10253) and probe_oar_node monkeypatch (#10241) - #10273
Merged
Conversation
…ar_node monkeypatch (#10241) Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
loopx-agent
commented
Dec 6, 2026
loopx-agent
left a comment
Collaborator
Author
There was a problem hiding this comment.
Reviewer: model_agent · gemini-3.1-pro · google-antigravity · self_reported
Exact head: 10273@1126007e01830e5d56b2401b06c16e866d93f9e6
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
动机
PR #10253(DHCP 安全锁恢复,machine_id 识别同机)与 PR #10241(将 loopx/cli_commands/workbench.py 中的 probe_node 更名为 probe_oar_node)合入主干后,两项既有测试因仍沿用旧夹具与旧属性名发生确定性失败:
tests/control_plane/test_agent_lifecycle_state.py::test_a_foreign_host_holder_is_unknown仅覆盖host="another-machine"而保留本机machine_id,被新逻辑判定为本机 DHCP 改名而非异机持有者;tests/test_workbench_cli.py::test_start_tolerates_dual_default_registry_conflict_without_runtime_root仍monkeypatch.setattr(wb_cmd, "probe_node", ...)报AttributeError。
- 受影响调用方/运维方:执行全量
pytest认证(v2.4.2发布门禁)与本地回归验证的开发者。 - 改动前后场景:改动前两项用例 100% 确定性失败;改动后两套文件 80 passed, 11 skipped in 7.88s。
- 可观测结果:
pytest -q tests/control_plane/test_agent_lifecycle_state.py tests/test_workbench_cli.py(80 passed, 11 skipped in 7.88s)、ruff check、loopx check与canary premerge全部通过。 - 非目标:不修改任何生产代码,不削弱
file_lock.py的machine_id同机识别或workbench.py的probe_oar_node门禁。
改动思路
仅在两项测试中同步两行夹具代码:在异机锁持有者测试中同时写入异机 machine_id="foreign-machine-id" 以真实模拟跨机持有者;在 Workbench 启动测试中将 monkeypatch 目标从已删除的 probe_node 更新为 probe_oar_node 并提供 version="24.21.0"。
具体改动
tests/control_plane/test_agent_lifecycle_state.py(+1/-1):_rewrite_holder(_lane(runtime_root), host="another-machine", machine_id="foreign-machine-id")。tests/test_workbench_cli.py(+1/-1):monkeypatch.setattr(wb_cmd, "probe_oar_node", lambda: SimpleNamespace(ready=True, executable="node", version="24.21.0"))。
对主干的风险
风险极低。仅 2 行纯测试修改(+2/-2),零生产代码变更,保持了所有异机锁未知态判定与双默认注册表容错不变量。
我的整体评价
极简、精准的 2 行测试契约同步修复,清除了 PR #10253 与 #10241 在主干遗留的 2 项确定性失败,满足精确头自合并标准。
English verdict: APPROVE
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.
Goal / Problem
Two tests drifted after PR #10253 and PR #10241 merged to
main:tests/control_plane/test_agent_lifecycle_state.py::test_a_foreign_host_holder_is_unknown: PR feat(workbench,steward): add monitor Run now routing, GraphQL 502 step-down, and DHCP-safe lock recovery #10253 addedmachine_idto lock holder records for DHCP-safe same-machine recovery, so overwriting onlyhost="another-machine"left the localmachine_idintact and matched the local machine instead of a foreign host.tests/test_workbench_cli.py::test_start_tolerates_dual_default_registry_conflict_without_runtime_root: PR feat(oar): multiplex session host, direct Node Workbench bridge, and parent quota channel #10241 renamedprobe_nodetoprobe_oar_nodeinloopx/cli_commands/workbench.py.Changes (test-only, 2 lines across 2 files)
tests/control_plane/test_agent_lifecycle_state.py: passmachine_id="foreign-machine-id"when simulating a foreign host lock holder.tests/test_workbench_cli.py: monkeypatchwb_cmd.probe_oar_nodeinstead of removedwb_cmd.probe_node.Verification
pytest -q tests/control_plane/test_agent_lifecycle_state.py tests/test_workbench_cli.py: all passed.ruff check,loopx check, andloopx canary premerge --from-git-diff --git-diff-base origin/main: all passed.