From 02f8d3757b2e092a42a5ec554e12f3f9ba6e3941 Mon Sep 17 00:00:00 2001 From: emil Date: Tue, 23 Jun 2026 18:43:58 +0000 Subject: [PATCH] DEVX-14: fix: set fresh MOLECULE_HOME per pair to avoid stale config cache --- src/devx/molecule/molecule_ci_guard.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/devx/molecule/molecule_ci_guard.py b/src/devx/molecule/molecule_ci_guard.py index 4ca4fea..5585e75 100644 --- a/src/devx/molecule/molecule_ci_guard.py +++ b/src/devx/molecule/molecule_ci_guard.py @@ -134,6 +134,12 @@ def build_env_for_pair(pair: str, base_env: dict[str, str]) -> dict[str, str]: elif "MOLECULE_PLATFORM_COMMAND" in env: del env["MOLECULE_PLATFORM_COMMAND"] env["ANSIBLE_ALLOW_BROKEN_CONDITIONALS"] = "true" + # Use a fresh MOLECULE_HOME per pair to avoid stale config cache + # from previous CI runs (causes "Instances missing" errors). + if "MOLECULE_HOME" not in env: + import tempfile + + env["MOLECULE_HOME"] = tempfile.mkdtemp(prefix="molecule-ci-") return env