Skip to content
This repository was archived by the owner on Mar 31, 2026. It is now read-only.
This repository was archived by the owner on Mar 31, 2026. It is now read-only.

test_bucket_w_retention_period flakes due to EC #551

Description

@tseaver

From this Kokoro failure:

________________________test_bucket_w_retention_period________________________storage_client=<google.cloud.storage.client.Clientobjectat0x7f229517cd10>buckets_to_delete= [<Bucket: w-retention-period-1629442620182>]
blobs_to_delete= [<Blob: w-retention-period-1629442620182, test-blob, 1629442620932109>]
deftest_bucket_w_retention_period(
storage_client, buckets_to_delete, blobs_to_delete,
):
period_secs=10bucket_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_secsbucket.default_event_based_hold=Falsebucket.patch()
assertbucket.retention_period==period_secsassertisinstance(bucket.retention_policy_effective_time, datetime.datetime)
assertnotbucket.default_event_based_holdassertnotbucket.retention_policy_lockedblob_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)
assertnotother.event_based_holdassertnotother.temporary_holdassertisinstance(other.retention_expiration_time, datetime.datetime)
withpytest.raises(exceptions.Forbidden):
other.delete()
bucket.retention_period=Nonebucket.patch()
assertbucket.retention_periodisNoneassertbucket.retention_policy_effective_timeisNoneassertnotbucket.default_event_based_holdassertnotbucket.retention_policy_lockedother.reload()
assertnotother.event_based_holdassertnotother.temporary_hold>assertother.retention_expiration_timeisNoneEassertdatetime.datetime(2021, 8, 20, 6, 57, 10, 949000, tzinfo=<UTC>) isNoneE+wheredatetime.datetime(2021, 8, 20, 6, 57, 10, 949000, tzinfo=<UTC>) =<Blob: w-retention-period-1629442620182, test-blob, 1629442620932109>.retention_expiration_timetests/system/test_bucket.py:572: AssertionError

Metadata

Metadata

Assignees

Labels

api: storageIssues related to the googleapis/python-storage API.flakyflaky systests / samplestype: processA process-related concern. May include testing, release, or the like.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions