Skip to content

fix(bigquery-jdbc): enable ITOpenTelemetryTest - #13991

Open
keshavdandeva wants to merge 7 commits into
mainfrom
jdbc-test-otel-failing-it
Open

fix(bigquery-jdbc): enable ITOpenTelemetryTest#13991
keshavdandeva wants to merge 7 commits into
mainfrom
jdbc-test-otel-failing-it

Conversation

@keshavdandeva

@keshavdandeva keshavdandeva commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

b/540093018

Problem

  • ITOpenTelemetryTest was failing when run in the nightly test suite because an earlier test in ITBigQueryJDBCTest stripped all handlers from the "com.google.cloud.bigquery" logger in its finally block, including OpenTelemetryJulHandler.

Changes

  • ITBigQueryJDBCTest.java: Restrict logger cleanup in testLogPathWithLogLevel to preserve OpenTelemetryJulHandler
  • BigQueryConnection.java: Defensively call BigQueryJdbcOpenTelemetry.ensureGlobalHandlerAttached() in getOpenTelemetryInstance() so any new connection re-attaches OpenTelemetryJulHandler if removed.
  • OpenTelemetryJulHandler.java:
    • Use ErrorManager.reportError(...) in publish(...) and flush() instead of empty catch blocks.
  • ITOpenTelemetryTest.java:
    • Remove @Tag("known_issue") to re-enable ITOpenTelemetryTest in CI/nightly builds.
    • Reduce maxAttempts in pollWithRetry(...) from 24 back down to 10.
  • pom.xml: Remove obsolete IPv4 test properties (preferIpv4.test.argLine) from surefire and failsafe configurations.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request ensures the global OpenTelemetry handler is attached, reports errors during log publishing and flushing in OpenTelemetryJulHandler instead of silently ignoring them, refines the handler cleanup in ITBigQueryJDBCTest to target specific handlers, and enables the ITOpenTelemetryTest by removing the @tag("known_issue") annotation. Feedback was provided to avoid wrapping all Throwable instances in a new Exception, avoid fully qualified class names, and use class references instead of fragile string matching for handler cleanup.

@keshavdandeva

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request removes the IPv4 test argument configuration from the POM file, ensures the global OpenTelemetry handler is attached during connection initialization, and improves error reporting in OpenTelemetryJulHandler by using ErrorManager instead of silently ignoring exceptions. Additionally, integration tests are updated to prevent removing the OpenTelemetryJulHandler during cleanup and to re-enable the OpenTelemetry integration test. The feedback recommends retaining @{argLine} in the Maven surefire and failsafe plugin configurations to preserve arguments from other plugins (e.g., JaCoCo).

Comment thread java-bigquery-jdbc/pom.xml
Comment thread java-bigquery-jdbc/pom.xml
@keshavdandeva
keshavdandeva marked this pull request as ready for review August 4, 2026 20:50
@keshavdandeva
keshavdandeva requested review from a team as code owners August 4, 2026 20:50
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