fix(bigquery-jdbc): enable ITOpenTelemetryTest - #13991
Conversation
There was a problem hiding this comment.
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.
|
/gemini review |
There was a problem hiding this comment.
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).
b/540093018
Problem
ITOpenTelemetryTestwas failing when run in the nightly test suite because an earlier test inITBigQueryJDBCTeststripped all handlers from the"com.google.cloud.bigquery"logger in itsfinallyblock, includingOpenTelemetryJulHandler.Changes
ITBigQueryJDBCTest.java: Restrict logger cleanup intestLogPathWithLogLevelto preserveOpenTelemetryJulHandlerBigQueryConnection.java: Defensively callBigQueryJdbcOpenTelemetry.ensureGlobalHandlerAttached()ingetOpenTelemetryInstance()so any new connection re-attachesOpenTelemetryJulHandlerif removed.OpenTelemetryJulHandler.java:ErrorManager.reportError(...)inpublish(...)andflush()instead of empty catch blocks.ITOpenTelemetryTest.java:@Tag("known_issue")to re-enableITOpenTelemetryTestin CI/nightly builds.maxAttemptsinpollWithRetry(...)from24back down to10.pom.xml: Remove obsolete IPv4 test properties (preferIpv4.test.argLine) from surefire and failsafe configurations.