This repository was archived by the owner on Mar 31, 2026. It is now read-only.
Description Note: #910 was also for this test, but it was closed more than 10 days ago. So, I didn't mark it flaky.
commit: 504995f
buildURL: Build Status , Sponge
status: failed
Test output storage_client =
buckets_to_delete = []
blobs_to_delete = []
def test_bucket_w_retention_period(
storage_client,
buckets_to_delete,
blobs_to_delete,
):
period_secs = 3
bucket_name = _helpers.unique_name("w-retention-period")
bucket = _helpers.retry_429_503(storage_client.create_bucket)(bucket_name)
buckets_to_delete.append(bucket)
bucket.retention_period = period_secs
bucket.default_event_based_hold = False
bucket.patch()
# Changes to the bucket will be readable immediately after writing,
# but configuration changes may take time to propagate.
_helpers.retry_has_retention_period(bucket.reload)()
assert bucket.retention_period == period_secs
assert isinstance(bucket.retention_policy_effective_time, datetime.datetime)
assert not bucket.default_event_based_hold
assert not bucket.retention_policy_locked
blob_name = "test-blob"
payload = b"DEADBEEF"
blob = bucket.blob(blob_name)
blob.upload_from_string(payload)
blobs_to_delete.append(blob)
other = bucket.get_blob(blob_name)
_helpers.retry_has_retention_expiration(other.reload)()
assert not other.event_based_hold
assert not other.temporary_hold
assert isinstance(other.retention_expiration_time, datetime.datetime)
with pytest.raises(exceptions.Forbidden):
E Failed: DID NOT RAISE <class 'google.api_core.exceptions.Forbidden'>
tests/system/test_bucket.py:662: Failed
Reactions are currently unavailable
Note: #910 was also for this test, but it was closed more than 10 days ago. So, I didn't mark it flaky.
commit: 504995f
buildURL: Build Status, Sponge
status: failed
Test output