Uh oh!
There was an error while loading. Please reload this page.
fix(tests): stop install-script E2E tests from killing live conductor processes - #333
Merged
Merged
Conversation
… processes The install_scripts-marked E2E suite runs install.sh/install.ps1's --auto-stop flag, whose find_running_conductor() scans the whole host process table and SIGTERM-kills every live conductor process it finds. Nothing deselected these tests by default, so a plain `pytest`, `pytest -m "not performance"`, or even CI's main test job (-m "not real_api and not performance", which never mentions install_scripts) would run them and could kill an unrelated live `conductor run --web-bg` workflow. - Generalize tests/conftest.py's real_api auto-skip hook (issue #326) to also cover the install_scripts marker, using the same word-boundary -m opt-in detection. - Default run_install_script(..., auto_stop=False) in install_scripts_helpers.py as defense-in-depth, so no call site triggers the host-wide kill unless a test explicitly opts in (only test_running_process_auto_stop_kills_and_continues does, and already passed auto_stop=True explicitly). - Add tests/test_config/test_install_scripts_marker.py, mirroring the existing real_api marker regression suite, to lock in the new auto-skip behavior (including a "test-the-test" case proving a reverted hook would be caught). Fixes#331 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Follow-up from code review of the #331 fix: - Add tests/test_integration/test_run_install_script_command.py: a fast, unmarked (non-install_scripts) test that mocks subprocess.run to verify run_install_script()'s auto_stop/force -> --auto-stop/--force command construction. This closes a gap where a future change to the auto_stop default wouldn't be caught by anything in the default (skipped install_scripts) test run - only by the E2E suite itself. Verified it fails when auto_stop's default is flipped back to True. - tests/conftest.py: trim duplicated rationale between the _OPT_IN_MARKER_NAMES comment and the pytest_collection_modifyitems docstring (defer to the docstring), and correct an imprecise claim that make test relies on this hook for install_scripts - it doesn't, since Makefile's own -m "not install_scripts" already deselects it natively; the hook is only load-bearing there for real_api. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes#331 — the install-script E2E suite (
@pytest.mark.install_scripts) drivesinstall.sh/install.ps1's--auto-stopflag, whosefind_running_conductor()scans the whole host process table and SIGTERM-kills every liveconductorprocess it finds. Nothing deselected these tests by default, so a plainpytest,pytest -m "not performance", or even CI's main test job (-m "not real_api and not performance", which never mentionsinstall_scripts) would run them and could silently kill an unrelated liveconductor run --web-bgworkflow.Changes
tests/conftest.py: generalized the existingreal_apiauto-skip hook (issue real_api tests are not deselected by default; running the suite spawns real copilot subprocesses (can silently kill a live --web-bg workflow) #326) into a loop over("real_api", "install_scripts"), using the same word-boundary-mopt-in detection. Both markers now auto-skip unless the caller's-mexpression explicitly references them.tests/test_integration/install_scripts_helpers.py:run_install_script(..., auto_stop=True)→ defaultFalse(defense-in-depth). Onlytest_running_process_auto_stop_kills_and_continuesneeds the kill behavior and already passesauto_stop=Trueexplicitly, so no other call sites changed.tests/test_config/test_install_scripts_marker.py(new): regression suite mirroringtest_real_api_marker.py's pytester-based approach — covers default skip,-m "not performance", CI's exact main-job expression, explicit-m install_scriptsopt-in,-m "not install_scripts"(currentmake testfilter), regex word-boundary robustness, and a "test-the-test" case proving a reverted hook would be caught.test_install_scripts.py/install_scripts_helpers.pydocstrings reflecting the new safe-by-default behavior.Out of scope
install.sh/install.ps1'sfind_running_conductorhost-wide scan breadth — explicitly called out as optional in the issue.Makefile's existing-m "not install_scripts"filters — redundant with the new hook now but harmless, kept for explicitness.Verification
test_install_scripts_marker.pysuite: 7/7 passed.test_real_api_marker.py: 6/6 passed (no regression from generalizing the hook).uv run pytest -m "not performance" -q: allinstall_scripts-marked tests now showSKIPPED ... install_scripts test: opt in with -m install_scripts(previously they ran).uv run pytest -m "not install_scripts and not performance": 4184 passed, 0 failed.make lint,make typecheck: clean (one pre-existing, unrelatedtywarning indialog_evaluator.pyconfirmed present onmaintoo).tests/test_performance.py::TestForEachPerformance::test_batching_scalabilityfails identically on unmodifiedmain— pre-existing timing flake, unrelated to this change.