This is an automated email from the ASF dual-hosted git repository. vatsrahul1001 pushed a commit to branch fix-otel-config-priorities-test-isolation in repository https://gitbox.apache.org/repos/asf/airflow.git
commit 9f0a88bf391738614f15d35c6e830ff28313a623 Author: Rahul Vats <[email protected]> AuthorDate: Wed Oct 28 12:02:52 2026 +0530 Isolate otel config-priority test from ambient OTEL env vars test_config_priorities asserts that the Airflow config host/port is used when a case provides no OTEL endpoint env var. It applied only the case's provided_env_vars on top of the ambient environment, so any OTEL_* var already exported by the runner leaked in. RunsOn CI runners export OTEL_EXPORTER_OTLP_ENDPOINT (resolving to 127.0.0.1:4318), which wins over the Airflow config and failed the six config-priority cases on both main and the release branches. Clear all OTEL_* env vars before applying provided_env_vars so the test only sees its own inputs regardless of the runner environment. --- .../observability/tests/observability/metrics/test_otel_logger.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/shared/observability/tests/observability/metrics/test_otel_logger.py b/shared/observability/tests/observability/metrics/test_otel_logger.py index cc821771372..461ce7f09cf 100644 --- a/shared/observability/tests/observability/metrics/test_otel_logger.py +++ b/shared/observability/tests/observability/metrics/test_otel_logger.py @@ -499,7 +499,15 @@ class TestOtelMetrics: airflow_conf_port, expected_endpoint, expected_exporter_module, + monkeypatch, ): + # Clear any ambient OTEL_* vars so the case only sees its own provided_env_vars. + # CI runners (e.g. RunsOn) export OTEL_EXPORTER_OTLP_ENDPOINT, which otherwise wins + # over the Airflow config host/port and makes the config-priority cases fail. + for name in list(os.environ): + if name.startswith("OTEL_"): + monkeypatch.delenv(name, raising=False) + with env_vars(provided_env_vars): otel_env_config = load_metrics_env_config()
