shahar1 opened a new pull request, #73212:
URL: https://github.com/apache/airflow/pull/73212

   ## Human Summary
   The module-level `unique_config_dir` fixture was accidentally replacing the 
entire environment with just `AIRFLOW_HOME` before starting a second Python 
process.
   When running on self-hosted runners (currently WIIP), this dropped 
`LD_LIBRARY_PATH`, which the `actions/setup-python` interpreter needs to find 
its shared libraries.
   
   The fix was to make this test class preserve the normal environment, point 
`AIRFLOW_HOME` to a temporary directory, and clear only the specific 
`AIRFLOW_CLI_API_*` variables being tested. Other tests still use the fully 
isolated environment.
   
   
   ## AI Summary
   <details><summary>Click Here</summary>
   The autouse `unique_config_dir` fixture in `test_client.py` runs 
`patch.dict(os.environ, ..., clear=True)`, so `TestRetryConfigurationEnvVars` 
spawned its child interpreter with an environment containing only 
`AIRFLOW_HOME` (no `PATH`, no `LD_LIBRARY_PATH`).
   
   A Python installed by `actions/setup-python` is built `--enable-shared` with 
an RPATH pointing at `/opt/hostedtoolcache/...`. On GitHub-hosted runners that 
path exists, so the child started by luck. On a self-hosted runner the 
toolcache lives elsewhere and the interpreter depends on the `LD_LIBRARY_PATH` 
that `setup-python` exports, so the child died before importing anything:
   
   ```
   .venv/bin/python: error while loading shared libraries: 
libpython3.10.so.1.0: cannot open shared object file: No such file or directory
   ```
   
   This overrides the fixture at class scope: the child inherits the real 
environment, and only the `AIRFLOW_CLI_API_*` knobs under test are removed so a 
developer's shell values cannot skew the expected results. The rest of the 
module keeps the strict cleared environment.
   
   Verified with `--setup-show` that the class-level override is the fixture 
that runs, and the full module passes under `-n 4`.
   </details>
   
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Code (Fable 5.1)
   
   Generated-by: Claude Code (Fable 5.1) following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to