Skip to content

chore(bigtable): improve system test instance usage - #18149

Open
daniel-sanche wants to merge 6 commits into
googleapis:mainfrom
daniel-sanche:fix_emulator_quota_issues
Open

chore(bigtable): improve system test instance usage#18149
daniel-sanche wants to merge 6 commits into
googleapis:mainfrom
daniel-sanche:fix_emulator_quota_issues

Conversation

@daniel-sanche

@daniel-sanche daniel-sanche commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

We have been hitting quota limits on bigtable system tests recently. This PR attempts to make a few improovements:

  • Patched a bug in the system_emulated tests, where the tests would still try to clean up stale GCP instances, even in emulator mode
    • Also set a new dummy GOOGLE_CLOUD_PROJECT envvar in system_emulated mode, to prevent talking to the live GCP environment
  • Improved the stale clean-up logic to add a cap to only clean up at max 5 old instances, along with additional logs
  • Identified a couple placed in the tests where we can re-use existing instances instead of spinning up new ones

@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 optimizes and improves the robustness of system tests by configuring the emulator environment, skipping stale instance cleanup when using the emulator, limiting the number of stale instance deletions to conserve API write quotas, and reusing existing instances in several test cases. The review feedback points out that catching generic exceptions during instance deletion could lead to noisy logs in CI/CD if an instance is already deleted, and suggests explicitly catching and ignoring NotFound exceptions.

Comment thread packages/google-cloud-bigtable/tests/system/utils.py Outdated
daniel-sanche and others added 2 commits August 18, 2026 16:40
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@daniel-sanche
daniel-sanche marked this pull request as ready for review August 19, 2026 23:01
@daniel-sanche
daniel-sanche requested a review from a team as a code owner August 19, 2026 23:01
cluster_id=alt_cluster_id,
location_id=location_id,
serve_nodes=1,
# Testing `Backup.restore()`:

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.

did this change the behavior? it was testing restoring to a different instance before. Now it's just backing up to a different table? on the same instance?

client.delete_instance(name=instance.name)
except NotFound:
pass
try:

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.

Are instances cleaned up properly in the tests? Over time, would this cause instances to slowly increase on the test project? and eventually we could run into SSD node or HDD node quota and will need to clean up the test project manually

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