Skip to content

fix(spanner): label instances in test_instance_api for stale cleanup - #19258

Closed
ohmayr wants to merge 1 commit into
mainfrom
fix/spanner-label-test-instances
Closed

ohmayr wants to merge 1 commit into
mainfrom
fix/spanner-label-test-instances

Conversation

@ohmayr

@ohmayr ohmayr commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

Context & Problem

test_create_instance and test_create_instance_with_processing_units create temporary Spanner instances without the python-spanner-systests and created labels, so cleanup_old_instances never sweeps them if a CI run crashes.

Summary of Changes

  • Pass the standard python-spanner-systests and created labels to spanner_client.instance() in test_create_instance and test_create_instance_with_processing_units.

Why This Approach

Matches the existing label convention used by shared_instance, test_backup_api, and test_database_api so crashed runs are automatically swept after 3 hours.

Intentionally Out of Scope

  • Modifying production Spanner client code
  • Sync/async teardown scrubbing changes (tracked in separate PRs)

Verification

nox -s lint mypy-3.14 unit-3.14 unit-3.10 cover and two independent Owl review passes

test_create_instance and test_create_instance_with_processing_units create temporary Spanner instances without the python-spanner-systests and created labels, so cleanup_old_instances never sweeps them if a CI run crashes.

@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 updates the system tests in test_instance_api.py to include tracking labels, specifically 'python-spanner-systests' and a 'created' timestamp, when creating test instances. I have no feedback to provide as the changes are straightforward and correct.

@ohmayr

ohmayr commented Nov 29, 2026

Copy link
Copy Markdown
Contributor Author

Closing speculative hardening PR without live leaked-resource evidence

@ohmayr ohmayr closed this Nov 29, 2026
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.

1 participant