This is an automated email from the ASF dual-hosted git repository.
shahar1 pushed a commit to branch airflow-ctl/v0-1-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/airflow-ctl/v0-1-test by this
push:
new ed04be0b3b5 [airflow-ctl/v0-1-test] Fix airflowctl retry env-var tests
failing on self-hosted runners (#73212) (#73223)
ed04be0b3b5 is described below
commit ed04be0b3b5fe73514ebf8768b93f360ed26f13e
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Tue Sep 15 23:06:23 2026 +0300
[airflow-ctl/v0-1-test] Fix airflowctl retry env-var tests failing on
self-hosted runners (#73212) (#73223)
The module-wide autouse fixture clears os.environ, so the retry tests
handed a child interpreter an environment with nothing but AIRFLOW_HOME.
A Python built with --enable-shared then cannot locate libpython unless
LD_LIBRARY_PATH survives, which is exactly what actions/setup-python
relies on outside /opt/hostedtoolcache. The tests only passed on
GitHub-hosted runners because the hardcoded RPATH happened to resolve.
Override the fixture for that class so the child inherits a real
environment, and drop only the AIRFLOW_CLI_API_* knobs under test so a
developer's shell cannot influence the result.
(cherry picked from commit b6f61b5f859e3fe323829db6949814f9ce782766)
Co-authored-by: Shahar Epstein <[email protected]>
---
airflow-ctl/tests/airflow_ctl/api/test_client.py | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/airflow-ctl/tests/airflow_ctl/api/test_client.py
b/airflow-ctl/tests/airflow_ctl/api/test_client.py
index b7e50073851..22fc749222d 100644
--- a/airflow-ctl/tests/airflow_ctl/api/test_client.py
+++ b/airflow-ctl/tests/airflow_ctl/api/test_client.py
@@ -530,6 +530,24 @@ def
test_credentials_rejects_unsafe_env_from_environment_variable(monkeypatch, a
class TestRetryConfigurationEnvVars:
"""The knobs are read at import time, so a bad value used to take down
even ``--help``."""
+ @pytest.fixture(autouse=True)
+ def unique_config_dir(self, monkeypatch, tmp_path):
+ """
+ Override the module fixture, which clears ``os.environ`` wholesale.
+
+ These tests hand the environment to a child interpreter, and starting
one needs more
+ than ``AIRFLOW_HOME``: a ``--enable-shared`` Python cannot find
``libpython`` without
+ the ``LD_LIBRARY_PATH`` its installer exported. Only the knobs under
test are dropped,
+ so a value in the developer's own shell cannot decide the result.
+ """
+ monkeypatch.setenv("AIRFLOW_HOME", str(tmp_path))
+ for name in (
+ "AIRFLOW_CLI_API_RETRIES",
+ "AIRFLOW_CLI_API_RETRY_WAIT_MIN",
+ "AIRFLOW_CLI_API_RETRY_WAIT_MAX",
+ ):
+ monkeypatch.delenv(name, raising=False)
+
@staticmethod
def _import_with(**env: str) -> subprocess.CompletedProcess:
return subprocess.run(