Skip to content

Commit 55860b5

Browse files
authored
test: increase timeout and number of retries for system and sample tests (#624)
Increasing instance deletion timeout to 2 hrs Increasing instance creation retries to 8
1 parent b5a567f commit 55860b5

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

samples/samples/backup_sample.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def create_backup(instance_id, database_id, backup_id, version_time):
3838
operation = backup.create()
3939

4040
# Wait for backup operation to complete.
41-
operation.result(1200)
41+
operation.result(2100)
4242

4343
# Verify that the backup is ready.
4444
backup.reload()
@@ -74,7 +74,7 @@ def create_backup_with_encryption_key(instance_id, database_id, backup_id, kms_k
7474
operation = backup.create()
7575

7676
# Wait for backup operation to complete.
77-
operation.result(1200)
77+
operation.result(2100)
7878

7979
# Verify that the backup is ready.
8080
backup.reload()

samples/samples/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import pytest
2525
from test_utils import retry
2626

27-
INSTANCE_CREATION_TIMEOUT = 240 # seconds
27+
INSTANCE_CREATION_TIMEOUT = 560 # seconds
2828

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

tests/system/_helpers.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@
3434
SKIP_BACKUP_TESTS = os.getenv(SKIP_BACKUP_TESTS_ENVVAR) is not None
3535

3636
INSTANCE_OPERATION_TIMEOUT_IN_SECONDS = int(
37-
os.getenv("SPANNER_INSTANCE_OPERATION_TIMEOUT_IN_SECONDS", 240)
37+
os.getenv("SPANNER_INSTANCE_OPERATION_TIMEOUT_IN_SECONDS", 560)
3838
)
3939
DATABASE_OPERATION_TIMEOUT_IN_SECONDS = int(
40-
os.getenv("SPANNER_DATABASE_OPERATION_TIMEOUT_IN_SECONDS", 60)
40+
os.getenv("SPANNER_DATABASE_OPERATION_TIMEOUT_IN_SECONDS", 120)
4141
)
4242

4343
USE_EMULATOR_ENVVAR = "SPANNER_EMULATOR_HOST"
@@ -57,7 +57,7 @@
5757

5858
retry_503 = retry.RetryErrors(exceptions.ServiceUnavailable)
5959
retry_429_503 = retry.RetryErrors(
60-
exceptions.TooManyRequests, exceptions.ServiceUnavailable,
60+
exceptions.TooManyRequests, exceptions.ServiceUnavailable, 8
6161
)
6262
retry_mabye_aborted_txn = retry.RetryErrors(exceptions.ServerError, exceptions.Aborted)
6363
retry_mabye_conflict = retry.RetryErrors(exceptions.ServerError, exceptions.Conflict)
@@ -107,7 +107,7 @@ def scrub_instance_ignore_not_found(to_scrub):
107107

108108

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

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

0 commit comments

Comments
 (0)