Skip to content

[v3-4-test] Isolate otel config-priority test from ambient OTEL env vars - #75843

Closed
vatsrahul1001 wants to merge 1 commit into
v3-4-testfrom
backport-otel-test-isolation-v3-4-test
Closed

vatsrahul1001 wants to merge 1 commit into
v3-4-testfrom
backport-otel-test-isolation-v3-4-test

Conversation

@vatsrahul1001

Copy link
Copy Markdown
Contributor

Manual backport of #75842 to v3-4-test.

Opened directly (rather than waiting on the auto-backport bot) to unblock the v3-4-test CI gate for the RC1 cut — this shared-distributions/observability failure is currently red on every open PR into the branch. The backport-to-v3-4-test label has been removed from #75842 to avoid a duplicate auto-backport.

Problem

TestOtelMetrics::test_config_priorities fails on v3-4-test (and main) for the six cases that expect the Airflow config host/port to be used when no OTEL endpoint env var is provided:

AssertionError: assert '...127.0.0.1:4318...' == '...breeze-otel-collector:4318...'

The test overlaid only each case's provided_env_vars without clearing other ambient OTEL_* vars. The RunsOn CI runners export OTEL_EXPORTER_OTLP_ENDPOINT (→ 127.0.0.1:4318), which correctly wins over the Airflow config, so the resolved endpoint is wrong. The test is non-hermetic; the production code is correct. This is why it fails on main and the release branches simultaneously — the runner env is shared.

Fix

Clear all OTEL_* env vars before applying the case's provided_env_vars, so the test only sees its own inputs regardless of the runner environment.

Testing

Reproduced the six failures locally by exporting OTEL_EXPORTER_OTLP_ENDPOINT, then confirmed all cases pass with the fix even with the ambient var set (10 passed).


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 4.8)

Generated-by: Claude Code (Opus 4.8) following the guidelines

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.

(cherry picked from commit 9f0a88b)
@vatsrahul1001

Copy link
Copy Markdown
Contributor Author

Closing in favour of #75844

@potiuk
potiuk deleted the backport-otel-test-isolation-v3-4-test branch November 4, 2026 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant