Skip to content

Commit

Permalink
test: harden 'bucket_cmek' systests against EC (googleapis#514)
Browse files Browse the repository at this point in the history
  • Loading branch information
tseaver authored and cojenco committed Oct 13, 2021
1 parent e3889d5 commit ee3f969
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions tests/system/_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion tests/system/test_kms_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit ee3f969

Please sign in to comment.