From 79d7177e18104b761d95eaee58385a0c6dcaa0b9 Mon Sep 17 00:00:00 2001 From: Astha Mohta Date: Tue, 12 Oct 2021 23:58:53 +0530 Subject: [PATCH 1/3] fix: increasng timeout and number of retries --- tests/system/_helpers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/system/_helpers.py b/tests/system/_helpers.py index ffd099b996..c48fa8e073 100644 --- a/tests/system/_helpers.py +++ b/tests/system/_helpers.py @@ -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) @@ -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 # one hour ago instance_filter = "labels.python-spanner-systests:true" for instance_pb in spanner_client.list_instances(filter_=instance_filter): From be121316c9325637eb3e64f4fb1c171d0ae906d4 Mon Sep 17 00:00:00 2001 From: Astha Mohta Date: Thu, 14 Oct 2021 11:52:27 +0530 Subject: [PATCH 2/3] fix: increasing timeout values --- samples/samples/backup_sample.py | 4 ++-- samples/samples/conftest.py | 2 +- tests/system/_helpers.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/samples/samples/backup_sample.py b/samples/samples/backup_sample.py index 196cfbe04b..4b2001a0e6 100644 --- a/samples/samples/backup_sample.py +++ b/samples/samples/backup_sample.py @@ -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() @@ -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() diff --git a/samples/samples/conftest.py b/samples/samples/conftest.py index b7832c1e8d..b3728a4db4 100644 --- a/samples/samples/conftest.py +++ b/samples/samples/conftest.py @@ -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) diff --git a/tests/system/_helpers.py b/tests/system/_helpers.py index c48fa8e073..7da7d7741d 100644 --- a/tests/system/_helpers.py +++ b/tests/system/_helpers.py @@ -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" From f96ab7533482a2cc71d5a6874e81b0b933a9580a Mon Sep 17 00:00:00 2001 From: Astha Mohta <35952883+asthamohta@users.noreply.github.com> Date: Tue, 19 Oct 2021 13:19:17 +0530 Subject: [PATCH 3/3] Update tests/system/_helpers.py Co-authored-by: larkee <31196561+larkee@users.noreply.github.com> --- tests/system/_helpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/system/_helpers.py b/tests/system/_helpers.py index 7da7d7741d..2d0df01718 100644 --- a/tests/system/_helpers.py +++ b/tests/system/_helpers.py @@ -107,7 +107,7 @@ def scrub_instance_ignore_not_found(to_scrub): def cleanup_old_instances(spanner_client): - cutoff = int(time.time()) - 2 * 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):