GeezerVison is showing github.com — fix(bigquery-jdbc): resolve `ITOpenTelemetryTest` pipeline and trace validation failures by keshavdandeva · Pull Request #13898 · googleapis/google-cloud-java
Conversation
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 [email protected]. Confirmed all 6/6 tests compile and pass successfully.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
gemini-code-assist[bot] reacted with eyes emoji
There was a problem hiding this comment.
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.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
logachev
logachev approved these changes
+1 more reviewer
Reviewers whose approvals may not affect merge requirements
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.