-
Notifications
You must be signed in to change notification settings - Fork 163
Closed
Labels
api: storageIssues related to the googleapis/python-storage API.Issues related to the googleapis/python-storage API.type: processA process-related concern. May include testing, release, or the like.A process-related concern. May include testing, release, or the like.
Description
Kokoro failed with flaky test:
______________________ test_bucket_w_default_kms_key_name ______________________
kms_bucket = <Bucket: gcp-systest-kms-1635439051141>
blobs_to_delete = [<Blob: gcp-systest-kms-1635439051141, default-kms-key-name, 1635439052948566>]
kms_key_name = 'projects/precise-truck-742/locations/us/keyRings/gcs-test/cryptoKeys/gcs-test'
alt_kms_key_name = 'projects/precise-truck-742/locations/us/keyRings/gcs-test/cryptoKeys/gcs-test-alternate'
file_data = {'big': {'hash': b'cEome4a+NYd7YIXzXQnR5Q==', 'path': '/tmpfs/src/github/python-storage/tests/data/five-point-one-mb-f...g'}, 'simple': {'hash': b'3Hkwjv2WvCnKjNR6Z3CboA==', 'path': '/tmpfs/src/github/python-storage/tests/data/simple.txt'}}
@_helpers.retry_failures
def test_bucket_w_default_kms_key_name(
kms_bucket, blobs_to_delete, kms_key_name, alt_kms_key_name, file_data,
):
blob_name = "default-kms-key-name"
override_blob_name = "override-default-kms-key-name"
alt_blob_name = "alt-default-kms-key-name"
cleartext_blob_name = "cleartext"
info = file_data["simple"]
with open(info["path"], "rb") as file_obj:
payload = file_obj.read()
kms_bucket.default_kms_key_name = kms_key_name
kms_bucket.patch()
assert kms_bucket.default_kms_key_name == kms_key_name
defaulted_blob = kms_bucket.blob(blob_name)
defaulted_blob.upload_from_filename(info["path"])
blobs_to_delete.append(defaulted_blob)
assert defaulted_blob.download_as_bytes() == payload
# We don't know the current version of the key.
> assert defaulted_blob.kms_key_name.startswith(kms_key_name)
E AttributeError: 'NoneType' object has no attribute 'startswith'
tests/system/test_kms_integration.py:152: AttributeError
Metadata
Metadata
Assignees
Labels
api: storageIssues related to the googleapis/python-storage API.Issues related to the googleapis/python-storage API.type: processA process-related concern. May include testing, release, or the like.A process-related concern. May include testing, release, or the like.