GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test(bqjdbc): add unit tests for OTel tracing by keshavdandeva · Pull Request #12943 · googleapis/google-cloud-java

Conversation

@keshavdandeva

@keshavdandeva keshavdandeva commented Apr 27, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

b/491245568

Changes

Enhanced Unit Testing Infrastructure

  • OpenTelemetryTestUtility: Introduced a shared utility to simplify complex OTel assertions
  • BigQueryStatementTest: Added comprehensive parameterised tracing tests for all execution paths, including attribute validation for queries and batch operations.
  • BigQueryDatabaseMetaDataTest: Instrumented all metadata discovery methods and added corresponding unit tests to verify span generation using parameterised tests

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gemini-code-assist[bot] reacted with eyes emoji
All reactions
  • 👀 1 reaction
keshavdandeva added 7 commits April 24, 2026 14:45
@keshavdandeva
feat(bigquery-jdbc): extend OpenTelemetry instrumentation for metadat…
73984ad
…a and pagination
@keshavdandeva
chore: narrowed the scope of the OTel context in next() to only cov…
3228f45
…er the blocking operation `buffer.take()`
@keshavdandeva
chore: add span links to db metadata methods
fd30068
@keshavdandeva
chore: minor improvements
409a3ab
@keshavdandeva
refactor: move core login to *impl methods and use withTrace generi…
4e9d6ae
…c function
@keshavdandeva
chore: refactor based on pr comments
ef20f9e
@keshavdandeva
test(jdbc): add unit tests for OTel tracing
119ad10
@keshavdandeva
keshavdandeva requested review from a team as code owners April 27, 2026 23:40
gemini-code-assist[bot]
gemini-code-assist Bot reviewed Apr 27, 2026
View reviewed changes

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

Copy link
Copy Markdown
Contributor

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 refactors BigQueryDatabaseMetaData by extracting asynchronous fetching logic for tables, columns, and schemas into dedicated methods marked @VisibleForTesting. It also updates OpenTelemetry tracing across BigQueryDatabaseMetaData and BigQueryStatement to ensure better context propagation and adds comprehensive unit tests to verify span generation. The review feedback highlights an inconsistency in the parameters passed to the refactored runGetTablesTaskAsync method and suggests improving the robustness of new tests by avoiding the capture of NullPointerException and using more specific assertions for verifying trace context links.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread ...oud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDatabaseMetaData.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryDatabaseMetaDataTest.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryDatabaseMetaDataTest.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryDatabaseMetaDataTest.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryDatabaseMetaDataTest.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@keshavdandeva
chore: minor refactors
c5e4c65
@keshavdandeva

keshavdandeva commented Apr 28, 2026

Copy link
Copy Markdown
Contributor Author

/gemini review

gemini-code-assist[bot] reacted with eyes emoji
All reactions
  • 👀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gemini-code-assist[bot]
gemini-code-assist Bot reviewed Apr 28, 2026
View reviewed changes

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

Copy link
Copy Markdown
Contributor

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 adds the opentelemetry-sdk-testing dependency and refactors BigQueryDatabaseMetaData to extract background task logic into testable methods, while enhancing OpenTelemetry tracing in both BigQueryDatabaseMetaData and BigQueryStatement. New tests are added to verify span generation and linking. The reviewer identified a missing method runNextPageTaskAsync in BigQueryStatement that will cause compilation errors and recommended using bounded thread pools for background tasks. Additionally, it is suggested to mock dependencies in tests rather than catching NullPointerException to verify span generation more reliably.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread ...-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryStatementTest.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryDatabaseMetaDataTest.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@keshavdandeva
keshavdandeva requested review from Neenu1995 and logachev April 28, 2026 00:20
@logachev

logachev commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

Please use bqjdbc in the title, so it will be easier to find PRs in the future (e.g. spanner has their own jdbc in that repo)

keshavdandeva reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

logachev
logachev reviewed Apr 28, 2026
View reviewed changes
Comment thread ...ogle-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryStatement.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryDatabaseMetaDataTest.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryDatabaseMetaDataTest.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryStatementTest.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryStatementTest.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@keshavdandeva keshavdandeva changed the title test(jdbc): add unit tests for OTel tracing test(bqjdbc): add unit tests for OTel tracing Apr 28, 2026
Base automatically changed from jdbc/add-otel-to-metadata to jdbc/feature-branch-otel April 28, 2026 13:31
keshavdandeva added 3 commits April 28, 2026 16:00
@keshavdandeva
Merge branch 'jdbc/feature-branch-otel' into jdbc/unit-tests-for-tracing
794ffb5
@keshavdandeva
chore: undo change from feature branch
f1f17b6
@keshavdandeva
refactor: use parameterised test and create utiltiy class
eeadd4f
@keshavdandeva

keshavdandeva commented Apr 28, 2026

Copy link
Copy Markdown
Contributor Author

/gemini review

gemini-code-assist[bot] reacted with eyes emoji
All reactions
  • 👀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gemini-code-assist[bot]
gemini-code-assist Bot reviewed Apr 28, 2026
View reviewed changes

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

Copy link
Copy Markdown
Contributor

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 introduces OpenTelemetry testing support and refactors BigQueryDatabaseMetaData and BigQueryStatement to enhance observability and testability. Key changes include extracting background task logic into testable methods and adding comprehensive unit tests to verify span generation and linking. The review feedback suggests a minor optimization in BigQueryStatement to cache the tracer instance instead of repeatedly fetching it within a pagination loop.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread ...ogle-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryStatement.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...ogle-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryStatement.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@keshavdandeva
keshavdandeva requested a review from logachev April 28, 2026 16:43
keshavdandeva added 2 commits April 28, 2026 16:50
@keshavdandeva
chore: enhance tests and utility class
caa5d4b
@keshavdandeva
fix: tracer inititalisation
8f6af0a
logachev
logachev approved these changes Apr 28, 2026
View reviewed changes
@keshavdandeva
keshavdandeva merged commit 20bb4f9 into jdbc/feature-branch-otel Apr 29, 2026
96 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@keshavdandeva
keshavdandeva deleted the jdbc/unit-tests-for-tracing branch April 29, 2026 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@logachev logachev logachev approved these changes
@Neenu1995 Neenu1995 Awaiting requested review from Neenu1995
+1 more reviewer
@gemini-code-assist gemini-code-assist[bot] gemini-code-assist[bot] left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

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.

2 participants

@keshavdandeva @logachev
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.