Skip to content

Commit 2d8093e

Browse files
chore(spanner): use nam6 instance config for test_create_instance_partition (#18271)
Cloud Spanner enforces DuplicatedBaseInstancePartitionConfigs ('Cannot create an instance partition that shares a base config with another instance partition.'). Since snippets.create_instance_partition creates an instance partition in nam3, update test_create_instance_partition in snippets_test.py to create the parent instance in nam6 rather than nam3. This satisfies the multi-region parent instance requirement while avoiding base config collision. Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [ ] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/google-cloud-python/issues) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [ ] Ensure the tests and linter pass - [ ] Code coverage does not decrease (if any source code was changed) - [ ] Appropriate docs were updated (if necessary) Fixes #<issue_number_goes_here> 🦕
1 parent 7126a54 commit 2d8093e

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

packages/google-cloud-spanner/samples/samples/snippets_test.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,17 +214,15 @@ def test_create_and_update_instance_default_backup_schedule_type(
214214
retry_429(instance.delete)()
215215

216216

217-
def test_create_instance_partition(
218-
capsys, instance_partition_instance_id, multi_region_instance_config
219-
):
217+
def test_create_instance_partition(capsys, instance_partition_instance_id):
220218
spanner_client = spanner.Client()
221219
instance = spanner_client.instance(instance_partition_instance_id)
222220
try:
223221
request = spanner_instance_admin.CreateInstanceRequest(
224222
parent=spanner_client.project_name,
225223
instance_id=instance_partition_instance_id,
226224
instance=spanner_instance_admin.Instance(
227-
config=multi_region_instance_config,
225+
config=f"{spanner_client.project_name}/instanceConfigs/nam6",
228226
display_name="Partition test instance",
229227
node_count=1,
230228
edition=spanner_instance_admin.Instance.Edition.ENTERPRISE_PLUS,

0 commit comments

Comments
 (0)