fix(agent): give ansible a blocking stdin boundary
All checks were successful
CD Pipeline / workflow-shape (push) Successful in 0s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Successful in 1m11s
CD Pipeline / build-and-deploy (push) Successful in 7m1s
CD Pipeline / post-deploy-checks (push) Successful in 2m21s
All checks were successful
CD Pipeline / workflow-shape (push) Successful in 0s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Successful in 1m11s
CD Pipeline / build-and-deploy (push) Successful in 7m1s
CD Pipeline / post-deploy-checks (push) Successful in 2m21s
This commit is contained in:
@@ -623,6 +623,7 @@ async def _run_ansible_command(spec: AnsibleCommandSpec, *, timeout_seconds: int
|
||||
*spec.command,
|
||||
cwd=str(spec.cwd),
|
||||
env=spec.env,
|
||||
stdin=asyncio.subprocess.DEVNULL,
|
||||
stdout=asyncio.subprocess.PIPE,
|
||||
stderr=asyncio.subprocess.PIPE,
|
||||
)
|
||||
|
||||
@@ -2660,6 +2660,7 @@ async def test_controlled_apply_duplicate_never_runs_subprocess(
|
||||
def test_ansible_subprocess_is_terminated_when_worker_task_is_cancelled() -> None:
|
||||
source = inspect.getsource(_run_ansible_command)
|
||||
|
||||
assert "stdin=asyncio.subprocess.DEVNULL" in source
|
||||
assert "except asyncio.CancelledError" in source
|
||||
assert "process.kill()" in source
|
||||
assert "await process.communicate()" in source
|
||||
|
||||
Reference in New Issue
Block a user