Skip to content

fix(bigquery-jdbc): resolve ITOpenTelemetryTest pipeline and trace validation failures - #13898

Merged
logachev merged 2 commits into
mainfrom
jdbc/fix-otel-it
Jul 27, 2026
Merged

fix(bigquery-jdbc): resolve ITOpenTelemetryTest pipeline and trace validation failures#13898
logachev merged 2 commits into
mainfrom
jdbc/fix-otel-it

Conversation

@keshavdandeva

@keshavdandeva keshavdandeva commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

b/539501245

This PR addresses two separate failures affecting the ITOpenTelemetryTest suite, one causing flakiness/failures in local validation, and the other causing deterministic timeouts in the nightly CI pipeline.

1. Fix Integration Test Trace ID Assertion (Logic Bug)

  • Root Cause: The ITOpenTelemetryTest suite fetched a list of connection logs from the GCP backend and blindly asserted the presence of a Trace ID on the very first log entry (entries.get(0)). However, the JDBC driver can emit logs outside the scope of a tracing span (e.g., during connection initialization or teardown). If one of these span-less logs happened to be the first one returned, the test falsely failed with Log entry must contain TraceId ==> expected: not <null>.
  • Fix: Updated the verification logic in verifyAndFetchLogs() to iterate through the retrieved logs and assert against the first log entry that actually contains a Trace ID.

2. Fix CI Pipeline OTLP Exporter Timeout (Network Bug)

  • Root Cause: Nightly CI runs were failing with java.io.InterruptedIOException: timeout, caused by a NoRouteToHostException when the OpenTelemetry Netty exporter attempted to route traffic to Google APIs over an IPv6 address (2607:f8b0...). Because the CI runner's environment lacks external IPv6 egress, the packets were silently blackholed, causing the network stack to hang until hitting the hardcoded 10-second OpenTelemetry timeout.
  • Fix: Added the <java.net.preferIPv4Stack>true</java.net.preferIPv4Stack> system property to the maven-surefire-plugin and maven-failsafe-plugin configurations in pom.xml. This forces the JVM to completely bypass the broken IPv6 route and exclusively resolve/route to IPv4 addresses, which the CI runner successfully supports.

Testing:

  • Ran make integration-test test=ITOpenTelemetryTest locally using SA github-actions@bigquery-devtools-drivers.iam.gserviceaccount.com. Confirmed all 6/6 tests compile and pass successfully.

@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 configures the Maven test plugins to prefer the IPv4 stack by setting the java.net.preferIPv4Stack system property to true. Additionally, it updates the integration test ITOpenTelemetryTest to iterate through the fetched log entries to find one with a non-null trace ID, rather than assuming the first entry contains it. I have no feedback to provide.

@keshavdandeva
keshavdandeva marked this pull request as ready for review July 27, 2026 15:31
@keshavdandeva
keshavdandeva requested review from a team as code owners July 27, 2026 15:31
@logachev
logachev enabled auto-merge (squash) July 27, 2026 17:59
@logachev
logachev merged commit c18141d into main Jul 27, 2026
206 checks passed
@logachev
logachev deleted the jdbc/fix-otel-it branch July 27, 2026 18:25
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