diff --git a/tests/system/_helpers.py b/tests/system/_helpers.py index 033450da3..05e4f8ba6 100644 --- a/tests/system/_helpers.py +++ b/tests/system/_helpers.py @@ -54,8 +54,13 @@ def _no_event_based_hold(blob): return not blob.event_based_hold +def _has_kms_key_name(blob): + return blob.kms_key_name is not None + + retry_bad_copy = RetryErrors(exceptions.BadRequest, error_predicate=_bad_copy) retry_no_event_based_hold = RetryInstanceState(_no_event_based_hold) +retry_has_kms_key_name = RetryInstanceState(_has_kms_key_name) def unique_name(prefix): diff --git a/tests/system/test_kms_integration.py b/tests/system/test_kms_integration.py index 123658a4e..a2df6848a 100644 --- a/tests/system/test_kms_integration.py +++ b/tests/system/test_kms_integration.py @@ -229,7 +229,7 @@ def test_blob_upload_w_bucket_cmek_enabled( blob.upload_from_string(payload) blobs_to_delete.append(blob) - _helpers.retry_429_harder(blob.reload)() + _helpers.retry_429_harder(_helpers.retry_has_kms_key_name(blob.reload))() # We don't know the current version of the key. assert blob.kms_key_name.startswith(kms_key_name)