Repository navigation
Isolate otel config-priority test from ambient OTEL env vars - #75842
Merged
Merged
Conversation
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.
vatsrahul1001
requested review from
amoghrajesh,
ashb and
potiuk
as code owners
October 28, 2026 06:33
amoghrajesh
reviewed
Oct 28, 2026
1 task done
Per review: clear ambient OTEL_* vars for every test in TestOtelMetrics rather than only test_config_priorities.
amoghrajesh
approved these changes
Oct 28, 2026
1 task
Contributor
|
Hi maintainer, this PR was merged without a milestone set.
|
Contributor
Backport successfully created: v3-4-testNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
|
github-actions Bot
pushed a commit
to aws-mwaa/upstream-to-airflow
that referenced
this pull request
Oct 28, 2026
…ars (apache#75842) * 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. * Move OTEL_* clearing into a class-scoped autouse fixture Per review: clear ambient OTEL_* vars for every test in TestOtelMetrics rather than only test_config_priorities. (cherry picked from commit 5df209d) Co-authored-by: Rahul Vats <43964496+vatsrahul1001@users.noreply.github.com>
vatsrahul1001
added a commit
that referenced
this pull request
Oct 28, 2026
…ars (#75842) (#75844) * 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. * Move OTEL_* clearing into a class-scoped autouse fixture Per review: clear ambient OTEL_* vars for every test in TestOtelMetrics rather than only test_config_priorities. (cherry picked from commit 5df209d) Co-authored-by: Rahul Vats <43964496+vatsrahul1001@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
TestOtelMetrics::test_config_prioritieshas started failing onmain(and the release branches) for the six cases that expect the Airflow config host/port to be used when a case provides no OTEL endpoint env var:The test applied only each case's
provided_env_varson top of the ambient environment viaenv_vars(...), which overlays but does not clear otherOTEL_*vars. The RunsOn CI runners exportOTEL_EXPORTER_OTLP_ENDPOINT(resolving to127.0.0.1:4318) for their own telemetry. For the cases that intentionally provide no endpoint env var, that ambient var leaks in and — correctly, per the config-priority rules — wins over the Airflow config, so the resolved endpoint becomes127.0.0.1:4318instead of the expected config host. The test is non-hermetic; the production code is correct.This is why it fails on
mainand every release branch at once (the runner env is shared), not a regression in the OTEL code.Fix
Clear all
OTEL_*env vars (viamonkeypatch.delenv) before applying the case'sprovided_env_vars, so the test only ever sees its own inputs regardless of the runner environment.Testing
Reproduced the exact six failures locally by exporting
OTEL_EXPORTER_OTLP_ENDPOINT, then confirmed all cases pass with the fix in place even with the ambient var set:Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 4.8) following the guidelines