Skip to content

test: increase timeout and number of retries for system and sample tests #624

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Oct 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions samples/samples/backup_sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def create_backup(instance_id, database_id, backup_id, version_time):
operation = backup.create()

# Wait for backup operation to complete.
operation.result(1200)
operation.result(2100)

# Verify that the backup is ready.
backup.reload()
Expand Down Expand Up @@ -74,7 +74,7 @@ def create_backup_with_encryption_key(instance_id, database_id, backup_id, kms_k
operation = backup.create()

# Wait for backup operation to complete.
operation.result(1200)
operation.result(2100)

# Verify that the backup is ready.
backup.reload()
Expand Down
2 changes: 1 addition & 1 deletion samples/samples/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import pytest
from test_utils import retry

INSTANCE_CREATION_TIMEOUT = 240 # seconds
INSTANCE_CREATION_TIMEOUT = 560 # seconds

retry_429 = retry.RetryErrors(exceptions.ResourceExhausted, delay=15)

Expand Down
8 changes: 4 additions & 4 deletions tests/system/_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
SKIP_BACKUP_TESTS = os.getenv(SKIP_BACKUP_TESTS_ENVVAR) is not None

INSTANCE_OPERATION_TIMEOUT_IN_SECONDS = int(
os.getenv("SPANNER_INSTANCE_OPERATION_TIMEOUT_IN_SECONDS", 240)
os.getenv("SPANNER_INSTANCE_OPERATION_TIMEOUT_IN_SECONDS", 560)
)
DATABASE_OPERATION_TIMEOUT_IN_SECONDS = int(
os.getenv("SPANNER_DATABASE_OPERATION_TIMEOUT_IN_SECONDS", 60)
os.getenv("SPANNER_DATABASE_OPERATION_TIMEOUT_IN_SECONDS", 120)
)

USE_EMULATOR_ENVVAR = "SPANNER_EMULATOR_HOST"
Expand All @@ -57,7 +57,7 @@

retry_503 = retry.RetryErrors(exceptions.ServiceUnavailable)
retry_429_503 = retry.RetryErrors(
exceptions.TooManyRequests, exceptions.ServiceUnavailable,
exceptions.TooManyRequests, exceptions.ServiceUnavailable, 8
)
retry_mabye_aborted_txn = retry.RetryErrors(exceptions.ServerError, exceptions.Aborted)
retry_mabye_conflict = retry.RetryErrors(exceptions.ServerError, exceptions.Conflict)
Expand Down Expand Up @@ -107,7 +107,7 @@ def scrub_instance_ignore_not_found(to_scrub):


def cleanup_old_instances(spanner_client):
cutoff = int(time.time()) - 1 * 60 * 60 # one hour ago
cutoff = int(time.time()) - 2 * 60 * 60 # two hour ago
instance_filter = "labels.python-spanner-systests:true"

for instance_pb in spanner_client.list_instances(filter_=instance_filter):
Expand Down