Skip to content

test: disable connector telemetry in test runs to remove CI ERROR-log noise#1500

Open
sd-db wants to merge 1 commit into
mainfrom
sd-db/disable-connector-telemetry-in-tests
Open

test: disable connector telemetry in test runs to remove CI ERROR-log noise#1500
sd-db wants to merge 1 commit into
mainfrom
sd-db/disable-connector-telemetry-in-tests

Conversation

@sd-db
Copy link
Copy Markdown
Collaborator

@sd-db sd-db commented Jun 5, 2026

Problem

On fully successful CI runs, the integration-test logs are flooded with ERROR-level noise — --- Logging error --- + traceback blocks and literal HTTP request error: %s lines — that buries real failures and inflates log artifacts (~4,000 of ~9,200 lines were noise in a sample green job, 78949595712).

Root cause of the bulk of it: the databricks-sql-connector (4.2.6, our locked version) enables telemetry by default and runs its POSTs on a background ThreadPoolExecutor. When those POSTs fail in CI (runner egress to the telemetry endpoint), the connector logs retry-exhaustion at ERROR on a background thread. Under pytest those records hit a capture handler whose stream has been closed at teardown, degrading into the --- Logging error --- blocks.

Fix

Test runs gain nothing from connector telemetry. Pass enable_telemetry=False through the test profiles' connection_parameters (which flows to dbsql.connect), so the connector uses its NoopTelemetryClient and emits no telemetry POSTs — removing the noise at the source.

This is scoped to tests/profiles.py only; no product code changes.

Verification

  • Confirmed against the locked connector (4.2.6): a dbt connection opened through the test profile reports telemetry_enabled is False and uses NoopTelemetryClient.
  • Verified against a real integration run on this PR head (27020859727): across all 8 e2e shards (cluster / uc-cluster / sqlwarehouse), the logs contained zero stray telemetry lines — no --- Logging error --- blocks, no ERROR:databricks.sql… lines, no I/O operation on closed file, no HTTP request error: %s. (The original sample job carried ~4,000 such lines.)
  • One unrelated test failed on that run (test_remove_foreign_key_constraint) due to a transient server-side Database Error [INTERNAL_ERROR] creating a foreign-key model — not related to telemetry or this change.

Follow-up (separate PR)

There is a related, independent user-facing bug — the logging bridge in dbt/adapters/databricks/logging.py forwards the raw %s template instead of the rendered message, so connector logs with placeholders render a literal %s on real dbt runs (e.g. Token exchange failed, using external token: %s, still visible in the run above). That fix (record.getMessage(), plus stopping databricks.sql records from propagating to the root logger) is deferred to its own PR.

The databricks-sql connector (4.2.6, the locked version) enables telemetry by
default and runs its POSTs on a background thread. When those POSTs fail in CI
they spam ERROR logs ("--- Logging error ---" blocks and literal
"HTTP request error: %s" lines) on otherwise-green runs, inflating log artifacts
and burying real failures.

Test runs gain nothing from telemetry, so pass enable_telemetry=False through
the test profile's connection_parameters; the connector then falls back to its
NoopTelemetryClient and emits no telemetry POSTs.
@sd-db sd-db requested a review from jprakash-db as a code owner June 5, 2026 14:27
@sd-db
Copy link
Copy Markdown
Collaborator Author

sd-db commented Jun 5, 2026

/integration-test

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 5, 2026

Integration tests dispatched for PR #1500 by @sd-db. Track progress in the Actions tab.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 5, 2026

Coverage report

This PR does not seem to contain any modification to coverable code.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 5, 2026

Integration results for PR #1500 — UC cluster ❌ failure · SQL warehouse ✅ success · All-purpose cluster ✅ success · Shard coverage ✅ success

Run details.

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.

2 participants