From b2dd2229f1da13dc4e0a6a70ce37660cdf10fe65 Mon Sep 17 00:00:00 2001 From: emil Date: Wed, 5 Aug 2026 20:55:47 +0200 Subject: [PATCH] fix: use --no-cache for ansible-galaxy to prevent concurrent cache corruption When 6 molecule runners install ansible-galaxy collections concurrently, they share the same response cache, causing: Missing expected 'results' in ansible-galaxy cache This may indicate cache corruption (from concurrent ansible-galaxy runs) Adding --no-cache bypasses the shared cache entirely, preventing the race condition. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- src/devx/tools/setup.py | 2 +- tests/unit/test_setup.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/devx/tools/setup.py b/src/devx/tools/setup.py index f960522..60fc7f4 100644 --- a/src/devx/tools/setup.py +++ b/src/devx/tools/setup.py @@ -62,7 +62,7 @@ def _install_ansible_collections(bin_dir: str) -> None: if not requirements.exists(): click.echo(" ansible/requirements.yml not found — skipping collections.") return - _run([galaxy, "collection", "install", "-r", str(requirements)]) + _run([galaxy, "collection", "install", "-r", str(requirements), "--no-cache"]) def _configure_tea_login() -> None: diff --git a/tests/unit/test_setup.py b/tests/unit/test_setup.py index 08383d3..ce2a69b 100644 --- a/tests/unit/test_setup.py +++ b/tests/unit/test_setup.py @@ -108,6 +108,8 @@ class TestInstallAnsibleCollections: mock_path.return_value.__str__ = lambda _: str(req) _install_ansible_collections(".venv/bin") mock_run.assert_called_once() + args = mock_run.call_args[0][0] + assert "--no-cache" in args, "ansible-galaxy must use --no-cache to avoid concurrent cache corruption" @patch("devx.tools.setup._run") def test_skips_when_no_requirements(self, mock_run: MagicMock) -> None: