From ef9409dc893bc91f2487f7e126999d19daa54d85 Mon Sep 17 00:00:00 2001 From: Xubin Ren <52506698+Re-bin@users.noreply.github.com> Date: Thu, 5 Nov 2026 10:40:51 +0800 Subject: [PATCH] ci: run Windows gateway stop checks with serial coordination --- .github/workflows/ci.yml | 5 ++++- tests/scripts/test_ci_workflows.py | 11 +++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0bf50ddb6..c9d43595b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,7 +76,7 @@ jobs: # scheduling below so one file cannot serialize all real venv work. # Bound real persistence contention: six workers can delay session # startup beyond its watchdog. Keep every assertion and test enabled. - pytest_args: "-n 4 --dist loadfile --ignore=tests/cli/test_commands.py --ignore=tests/cli/test_cli_input.py --ignore=tests/cli/test_desktop_target.py --ignore=tests/cli/test_desktop_target_entrypoints.py --ignore=tests/tools/test_exec_platform.py --ignore=tests/cli/test_wsl_browser.py --ignore=tests/test_install_scripts.py --ignore=tests/test_update_jobs.py --ignore=tests/test_update_profiles.py" + pytest_args: "-n 4 --dist loadfile --ignore=tests/cli/test_commands.py --ignore=tests/cli/test_cli_input.py --ignore=tests/cli/test_desktop_target.py --ignore=tests/cli/test_desktop_target_entrypoints.py --ignore=tests/tools/test_exec_platform.py --ignore=tests/cli/test_wsl_browser.py --ignore=tests/test_install_scripts.py --ignore=tests/test_update_jobs.py --ignore=tests/test_update_profiles.py --ignore=tests/test_update_stop.py" steps: - uses: actions/checkout@v4 @@ -136,10 +136,13 @@ jobs: - name: Check Windows update coordination before the full suite if: runner.os == 'Windows' + # Real gateway startup/stop must not compete with the parallel package + # and session-index fixtures. Keep its startup and lease assertions intact. run: >- uv run --no-sync python -m pytest tests/test_installation_lock.py tests/test_update_profiles.py + tests/test_update_stop.py tests/utils/test_helpers.py::test_atomic_record_reader_does_not_block_concurrent_replacement tests/gateway/test_runtime.py::test_runtime_state_publish_keeps_existing_snapshot_readable tests/gateway/test_runtime.py::test_runtime_state_reader_does_not_block_publish_while_decoding diff --git a/tests/scripts/test_ci_workflows.py b/tests/scripts/test_ci_workflows.py index babf01d8c..145debb72 100644 --- a/tests/scripts/test_ci_workflows.py +++ b/tests/scripts/test_ci_workflows.py @@ -73,3 +73,14 @@ def test_windows_installer_matrix_has_an_independent_required_job(): assert not any("tests/test_install_scripts.py" in step.get("run", "") for step in jobs["windows_process"]["steps"]) assert "windows_installers" in jobs["required"]["needs"] + + +def test_windows_gateway_stop_checks_run_serially_without_losing_coverage(): + job = workflow("ci.yml")["jobs"]["test"] + path = "tests/test_update_stop.py" + for item in job["strategy"]["matrix"]["include"]: + assert (f"--ignore={path}" in item["pytest_args"]) == (item["os"] == "windows-latest") + steps = [step for step in job["steps"] if path in step.get("run", "").split()] + assert len(steps) == 1 + assert steps[0]["if"] == "runner.os == 'Windows'" + assert "-n" not in steps[0]["run"].split()