From 4289aea2acee76b5c68dd760cd18aa3c9fd20a1f Mon Sep 17 00:00:00 2001 From: ChengLong GU <88359731+gcl-coder@users.noreply.github.com> Date: Sun, 1 Nov 2026 20:18:29 +0800 Subject: [PATCH] test: run the accepted-work fence assertion on Linux CI native_host.switch() refuses a non-macOS host at its entry gate, so test_native_restart_uses_real_accepted_work_fence_before_app_quit failed on Linux CI with `platform_unavailable` instead of reaching its `waiting_for_idle` assertion. The fence that protects accepted Chat work from a client restart was therefore never exercised on the Linux runner. Mock the platform at the host boundary so the platform-independent fence assertion runs on every CI platform. Signed-off-by: ChengLong GU <88359731+gcl-coder@users.noreply.github.com> --- tests/presentation/test_codex_accounts.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/presentation/test_codex_accounts.py b/tests/presentation/test_codex_accounts.py index 7b88b14e45..0f84a129be 100644 --- a/tests/presentation/test_codex_accounts.py +++ b/tests/presentation/test_codex_accounts.py @@ -430,6 +430,11 @@ def test_existing_busy_pause_reenters_new_readonly_preflight(native, tmp_path): @pytest.mark.parametrize("status", ["queued", "starting", "running", "completing", "interrupting", "invalid"]) def test_native_restart_uses_real_accepted_work_fence_before_app_quit(native, monkeypatch, tmp_path, status): from loopx.chat_store import ChatSessionStore + # The accepted-work fence is platform independent. native_host.switch() + # refuses a non-macOS host at its entry gate, so without this the Linux + # CI run stopped at `platform_unavailable` and never reached the + # `waiting_for_idle` assertion below. + monkeypatch.setattr(sys, "platform", "darwin") host_module = importlib.import_module("loopx_codex_provider_routing.native_host") store = ChatSessionStore(tmp_path / "runtime") sid = store.create_session(goal_id="test", agent_id="test", adapter_kind="fake",