Skip to content

test(bigtable): add integration tests for single-row reads - #14399

Merged
mutianf merged 6 commits into
googleapis:mainfrom
mutianf:add-read-it-tests
Sep 16, 2026
Merged

mutianf merged 6 commits into
googleapis:mainfrom
mutianf:add-read-it-tests

Conversation

@mutianf

@mutianf mutianf commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • ReadIT: adds three single-row read tests covering:
    • readSingleRowWithReadRowreadRow(tableId, rowKey) API
    • readSingleRowWithRowKeyQueryreadRows(Query.rowKey(key))
    • readSingleRowWithRowRangeQueryreadRows(Query.range(closed/closed same key))
    • Each test writes a row and asserts the exact key, family, qualifier, timestamp, and value returned

Test plan

  • All three ReadIT single-row tests passed locally (Tests run: 3, Failures: 0, Errors: 0)

…-row reads

- BuiltinMetricsIT: add testInternalMetrics to verify
  per_connection_error_count is exported to Cloud Monitoring; remove
  gRPC DirectPath metric tests that were not universally applicable
- ReadIT: add three tests (readSingleRowWithReadRow,
  readSingleRowWithRowKeyQuery, readSingleRowWithRowRangeQuery) covering
  readRow API, rowKey query, and closed/closed row range query, each
  asserting the exact cell content returned
@mutianf
mutianf requested review from a team as code owners September 16, 2026 14:03

@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 re-enables the BuiltinMetricsIT integration tests, adds a new test for internal metrics with NotFoundException handling for lazily created descriptors, and introduces three new single-row read tests in ReadIT.java. The review feedback suggests extending the query's time interval in testInternalMetrics to 10 minutes to match the polling timeout and refactoring the repetitive setup code in the new single-row read tests into a helper method to reduce duplication.

- BuiltinMetricsIT: remove table creation in testInternalMetrics (use
  shared test table; per_connection_error_count is connection-level);
  extend query interval to 10 min to match polling budget; revert
  INTERNAL_INSTRUMENT_PREFIX usage in testBuiltinMetricsWithCustomOTEL
- ReadIT: extract repeated write+expected-row setup into
  writeTestRowAndBuildExpected helper
Create a dedicated table with a unique prefix so metrics from this run
are isolated by time window from prior runs, and delete the table in a
finally block to guarantee cleanup.
Create a dedicated Bigtable instance with a unique name, run operations
against it, filter the Cloud Monitoring query on the unique instance ID,
and delete the instance in a finally block. This ensures metrics queried
belong strictly to this test run and not prior runs on the shared instance.
The OTel instruments are registered under the full
bigtable.googleapis.com/internal/client/ name, so the InMemoryMetricReader
stores them under that full name. The getMetricData lookup must use the
prefix to find them.
The PR should only contain single-row read tests in ReadIT.java.
Restore BuiltinMetricsIT.java to its pre-PR state (with @ignore).
@mutianf mutianf changed the title test(bigtable): add integration tests for internal metrics and single-row reads test(bigtable): add integration tests for single-row reads Sep 16, 2026
@mutianf
mutianf enabled auto-merge (squash) September 16, 2026 19:49
@mutianf
mutianf merged commit f7d3506 into googleapis:main Sep 16, 2026
210 checks passed
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