Skip to content

The agent that grows with you

test(installer): align Windows venv process guard with transactional parking (#83149)

JoaoMarcos44be1e0c89c98c
diff --git a/tests/test_install_unmerged_index.py b/tests/test_install_unmerged_index.py
index 8b218dd301e..35d403111fa 100644
--- a/tests/test_install_unmerged_index.py
+++ b/tests/test_install_unmerged_index.py
@@ -152,9 +152,9 @@ def test_install_sh_clears_unmerged_index_before_stash_source_order() -> None:
assert idx_unmerged < idx_stash
-def test_install_ps1_stops_venv_resident_processes_before_removing_venv() -> None:
+def test_install_ps1_stops_venv_resident_processes_before_parking_venv() -> None:
"""The Windows venv-recreate path must stop every process running out of the
- old venv before deleting it.
+ old venv before moving it aside.
A gateway autostarted by a scheduled task runs as
``venv\\Scripts\\pythonw.exe -m hermes_cli.main gateway run`` — image name
@@ -179,8 +179,8 @@ def test_install_ps1_stops_venv_resident_processes_before_removing_venv() -> Non
"the -like wildcard match must not be used for venv path scoping"
)
- # The process sweep must run before the venv is removed, or it is a no-op.
- idx_remove = text.index('Remove-Item -Recurse -Force "venv"', idx_recreate)
- assert idx_sweep < idx_remove, (
- "venv-resident processes must be stopped before Remove-Item deletes the venv"
+ # The process sweep must run before the venv is parked, or it is a no-op.
+ idx_park = text.index('Rename-Item -LiteralPath "venv"', idx_recreate)
+ assert idx_sweep < idx_park, (
+ "venv-resident processes must be stopped before Rename-Item parks the venv"
)