Skip to content

Commit

Permalink
chore: update edition to ENTERPRISE_PLUS to test all features
Browse files Browse the repository at this point in the history
  • Loading branch information
harshachinta committed Oct 16, 2024
1 parent b2e6762 commit 7978514
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions samples/samples/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from google.cloud.spanner_admin_database_v1.types.common import DatabaseDialect
from google.cloud.spanner_v1 import backup, client, database, instance
from test_utils import retry
from google.cloud.spanner_admin_instance_v1.types import spanner_instance_admin

INSTANCE_CREATION_TIMEOUT = 560 # seconds

Expand Down Expand Up @@ -128,17 +129,24 @@ def sample_instance(
instance_config,
sample_name,
):
sample_instance = spanner_client.instance(
instance_id,
instance_config,
labels={
"cloud_spanner_samples": "true",
"sample_name": sample_name,
"created": str(int(time.time())),
},
operation = spanner_client.instance_admin_api.create_instance(
parent=spanner_client.project_name,
instance_id=instance_id,
instance=spanner_instance_admin.Instance(
config=instance_config,
display_name="This is a display name.",
node_count=1,
labels={
"cloud_spanner_samples": "true",
"sample_name": sample_name,
"created": str(int(time.time())),
},
edition=spanner_instance_admin.Instance.Edition.ENTERPRISE_PLUS, # Optional
),
)
op = retry_429(sample_instance.create)()
op.result(INSTANCE_CREATION_TIMEOUT) # block until completion
operation.result(INSTANCE_CREATION_TIMEOUT) # block until completion

sample_instance = spanner_client.instance(instance_id)

# Eventual consistency check
retry_found = retry.RetryResult(bool)
Expand Down

0 comments on commit 7978514

Please sign in to comment.