Skip to content

Commit

Permalink
tests: harden instance admin systests vs timeout / 503 (#453)
Browse files Browse the repository at this point in the history
* tests: retry harder on ServiceUnavailable errors

Closes #450

* tests: bump all 30s timeouts to 60s for instance admin systests

Closes #451.
  • Loading branch information
tseaver authored Oct 20, 2021
1 parent a99bf88 commit 4d392b2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion tests/system/_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def _retry_on_unavailable(exc):


retry_grpc_unavailable = retry.RetryErrors(
core_exceptions.GrpcRendezvous, error_predicate=_retry_on_unavailable,
core_exceptions.GrpcRendezvous, error_predicate=_retry_on_unavailable, max_tries=9,
)


Expand Down
20 changes: 10 additions & 10 deletions tests/system/test_instance_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def _modify_app_profile_helper(
)

operation = app_profile.update(ignore_warnings=ignore_warnings)
operation.result(timeout=30)
operation.result(timeout=60)

alt_profile = instance.app_profile(app_profile_id)
alt_profile.reload()
Expand Down Expand Up @@ -155,7 +155,7 @@ def test_instance_create_prod(

operation = instance.create(clusters=[cluster])
instances_to_delete.append(instance)
operation.result(timeout=30) # Ensure the operation completes.
operation.result(timeout=60) # Ensure the operation completes.
assert instance.type_ is None

# Create a new instance instance and make sure it is the same.
Expand Down Expand Up @@ -186,7 +186,7 @@ def test_instance_create_development(

operation = instance.create(clusters=[cluster])
instances_to_delete.append(instance)
operation.result(timeout=30) # Ensure the operation completes.
operation.result(timeout=60) # Ensure the operation completes.

# Create a new instance instance and make sure it is the same.
instance_alt = admin_client.instance(alt_instance_id)
Expand Down Expand Up @@ -496,7 +496,7 @@ def test_instance_update_display_name_and_labels(
admin_instance_populated.labels = new_labels

operation = admin_instance_populated.update()
operation.result(timeout=30) # ensure the operation completes.
operation.result(timeout=60) # ensure the operation completes.

# Create a new instance instance and reload it.
instance_alt = admin_client.instance(admin_instance_id, labels={})
Expand All @@ -513,7 +513,7 @@ def test_instance_update_display_name_and_labels(
admin_instance_populated.display_name = old_display_name
admin_instance_populated.labels = instance_labels
operation = admin_instance_populated.update()
operation.result(timeout=30) # ensure the operation completes.
operation.result(timeout=60) # ensure the operation completes.


def test_instance_update_w_type(
Expand All @@ -536,12 +536,12 @@ def test_instance_update_w_type(

operation = instance.create(clusters=[cluster])
instances_to_delete.append(instance)
operation.result(timeout=30) # Ensure the operation completes.
operation.result(timeout=60) # Ensure the operation completes.

instance.display_name = None
instance.type_ = enums.Instance.Type.PRODUCTION
operation = instance.update()
operation.result(timeout=30) # ensure the operation completes.
operation.result(timeout=60) # ensure the operation completes.

# Create a new instance instance and reload it.
instance_alt = admin_client.instance(alt_instance_id)
Expand Down Expand Up @@ -573,7 +573,7 @@ def test_cluster_create(
default_storage_type=(enums.StorageType.SSD),
)
operation = cluster_2.create()
operation.result(timeout=30) # Ensure the operation completes.
operation.result(timeout=60) # Ensure the operation completes.

# Create a new object instance, reload and make sure it is the same.
alt_cluster = admin_instance_populated.cluster(alt_cluster_id)
Expand Down Expand Up @@ -603,7 +603,7 @@ def test_cluster_update(
admin_cluster.serve_nodes = new_serve_nodes

operation = admin_cluster.update()
operation.result(timeout=30) # Ensure the operation completes.
operation.result(timeout=60) # Ensure the operation completes.

# Create a new cluster instance and reload it.
alt_cluster = admin_instance_populated.cluster(admin_cluster_id)
Expand All @@ -613,4 +613,4 @@ def test_cluster_update(
# Put the cluster back the way it was for the other test cases.
admin_cluster.serve_nodes = serve_nodes
operation = admin_cluster.update()
operation.result(timeout=30) # Ensure the operation completes.
operation.result(timeout=60) # Ensure the operation completes.

0 comments on commit 4d392b2

Please sign in to comment.