From d11b0e500cd03fc58d968c2a9eadff7c3364717c Mon Sep 17 00:00:00 2001 From: JasonBuildAI Date: Sat, 31 Oct 2026 21:06:22 +0800 Subject: [PATCH] test(native-accounts): pin the platform for the accepted-work fence test The fence test added in b95e42f1e calls NativeHost.switch, which returns platform_unavailable outside macOS. The module is collected on every POSIX host, so all six parametrizations failed before restart_guard and the required test-shard lane has been red since the test merged. Pin the mocked host platform to darwin, following the existing client_host fixture in the same module, so Linux exercises the platform-neutral guard and store reader instead of stopping at the platform check. Signed-off-by: JasonBuildAI --- tests/presentation/test_codex_accounts.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/presentation/test_codex_accounts.py b/tests/presentation/test_codex_accounts.py index 7b88b14e45..d13877c86d 100644 --- a/tests/presentation/test_codex_accounts.py +++ b/tests/presentation/test_codex_accounts.py @@ -431,6 +431,10 @@ def test_existing_busy_pause_reenters_new_readonly_preflight(native, tmp_path): def test_native_restart_uses_real_accepted_work_fence_before_app_quit(native, monkeypatch, tmp_path, status): from loopx.chat_store import ChatSessionStore host_module = importlib.import_module("loopx_codex_provider_routing.native_host") + # The native account owner is macOS-only, but this fence reuses the + # platform-neutral Chat ingress lock and store reader. Pin the guard so the + # Linux lane exercises the fence instead of stopping at platform_unavailable. + monkeypatch.setattr(host_module.sys, "platform", "darwin") store = ChatSessionStore(tmp_path / "runtime") sid = store.create_session(goal_id="test", agent_id="test", adapter_kind="fake", upstream_thread_id="test", upstream_mode="managed")["session_id"]