From 7aae54f4db6e190dc35021b60f5718af802faade Mon Sep 17 00:00:00 2001 From: Hasan Basbunar Date: Fri, 20 Nov 2026 11:29:54 +0100 Subject: [PATCH] tests: the switch sandboxes copy oc-permissions.py, the merger's sibling e449833e made oc-merge-limits.py load oc-permissions.py at import time (one server matcher shared with the relay, review 7), and oc-point-default.py imports the merger, so every switch path that points opencode at the new lane or renames an entry now needs that sibling beside the helpers. The three switch sandboxes (test_lfm25_lane, test_lfm3_lane, test_switch_clients_only) copied the helpers without it: both crashed with FileNotFoundError, the NOTE lines went by, and cfg["model"] stayed on qwen38 after an lfm25/lfm3 switch while the flash-unsloth entry kept its placeholder name. On a box every helper runs from the repo root, where the sibling is present, so the behavior the tests protect is unchanged in production; the sandboxes now mirror the repo, as test_install_agent_v2.py already does. No assertion changed. Proof of the culprit: git archive of e449833e and of its parent, same invocation, the three files green before and red from e449833e on; with the sibling copied, all three pass on this branch (Ran 19 OK, Ran 21 OK skipped=1, Ran 3 OK). Generated by Mistral Vibe. Co-Authored-By: Claude Opus 5.5 --- tests/test_lfm25_lane.py | 3 ++- tests/test_lfm3_lane.py | 3 ++- tests/test_switch_clients_only.py | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/test_lfm25_lane.py b/tests/test_lfm25_lane.py index a0117e90..c40ed8bc 100644 --- a/tests/test_lfm25_lane.py +++ b/tests/test_lfm25_lane.py @@ -262,7 +262,8 @@ class TheSwitch(unittest.TestCase): (repo / "switch-model.sh").chmod(0o755) for f in ("install.sh", "lanes.sh", "boxmem.py", "ckpt-fetch.py", "install-lfm25.sh", "sglang-lane.sh", "vllm-lane.sh", "qwen38-lfm25.service.template", "oc-limits.sh", "oc-lfm25.py", "oc-merge-limits.py", - "oc-point-default.py", "pi-gen.py"): + # the merger loads its sibling, the server matcher (e449833e, review 7) + "oc-permissions.py", "oc-point-default.py", "pi-gen.py"): shutil.copy(REPO / f, repo / f) self.hf = self.t / "hf" # the unit an install put there: the 27B lane's image, this box's cache diff --git a/tests/test_lfm3_lane.py b/tests/test_lfm3_lane.py index a6b5fd2f..8a898406 100644 --- a/tests/test_lfm3_lane.py +++ b/tests/test_lfm3_lane.py @@ -259,7 +259,8 @@ class TheSwitch(unittest.TestCase): (repo / "switch-model.sh").chmod(0o755) for f in ("install.sh", "lanes.sh", "boxmem.py", "ckpt-fetch.py", "install-lfm3.sh", "vllm-lane.sh", "qwen38-lfm3.service.template", "oc-limits.sh", "oc-lfm3.py", "oc-merge-limits.py", - "oc-point-default.py", "pi-gen.py"): + # the merger loads its sibling, the server matcher (e449833e, review 7) + "oc-permissions.py", "oc-point-default.py", "pi-gen.py"): shutil.copy(REPO / f, repo / f) self.hf = self.t / "hf" self.unit = self.units / "qwen38-lfm3.service" diff --git a/tests/test_switch_clients_only.py b/tests/test_switch_clients_only.py index e7d4b57f..25a46886 100644 --- a/tests/test_switch_clients_only.py +++ b/tests/test_switch_clients_only.py @@ -53,7 +53,8 @@ class ClientsOnly(unittest.TestCase): for c in box.configs: c.write_text(json.dumps(base, indent=2) + "\n") # what the script runs beside it in this mode - for f in ("oc-limits.sh", "oc-merge-limits.py", "oc-point-default.py", gen, "pi-gen.py", "boxmem.py"): + # oc-permissions.py too: the merger loads its sibling, the server matcher (e449833e, review 7) + for f in ("oc-limits.sh", "oc-merge-limits.py", "oc-permissions.py", "oc-point-default.py", gen, "pi-gen.py", "boxmem.py"): (box.script.parent / f).write_text((REPO / f).read_text()) (box.script.parent / "oc-limits.sh").chmod(0o755) box.target_unit = unit