Skip to content

fix(test): align foreign-host machine_id fixture (#10253) and probe_oar_node monkeypatch (#10241) - #10273

Merged
loopx-agent merged 1 commit into
mainfrom
codex/fix-10253-10241-test-drift-20261206
Dec 6, 2026
Merged

loopx-agent merged 1 commit into
mainfrom
codex/fix-10253-10241-test-drift-20261206

Conversation

@loopx-agent

Copy link
Copy Markdown
Collaborator

Goal / Problem

Two tests drifted after PR #10253 and PR #10241 merged to main:

  1. 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 added machine_id to lock holder records for DHCP-safe same-machine recovery, so overwriting only host="another-machine" left the local machine_id intact and matched the local machine instead of a foreign host.
  2. 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 renamed probe_node to probe_oar_node in loopx/cli_commands/workbench.py.

Changes (test-only, 2 lines across 2 files)

  • tests/control_plane/test_agent_lifecycle_state.py: pass machine_id="foreign-machine-id" when simulating a foreign host lock holder.
  • tests/test_workbench_cli.py: monkeypatch wb_cmd.probe_oar_node instead of removed wb_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, and loopx canary premerge --from-git-diff --git-diff-base origin/main: all passed.

…ar_node monkeypatch (#10241)

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)合入主干后,两项既有测试因仍沿用旧夹具与旧属性名发生确定性失败:

  1. tests/control_plane/test_agent_lifecycle_state.py::test_a_foreign_host_holder_is_unknown 仅覆盖 host="another-machine" 而保留本机 machine_id,被新逻辑判定为本机 DHCP 改名而非异机持有者;
  2. 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

@loopx-agent
loopx-agent merged commit 7ac233d into main Dec 6, 2026
5 of 6 checks passed
@loopx-agent
loopx-agent deleted the codex/fix-10253-10241-test-drift-20261206 branch December 6, 2026 11:31
songoow pushed a commit that referenced this pull request Dec 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant