Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
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

Copy link
Copy link

Description

@tseaver
Issue body actions

From this Kokoro failure:

________________________ test_bucket_w_retention_period ________________________

storage_client = <google.cloud.storage.client.Client object at 0x7f229517cd10>
buckets_to_delete = [<Bucket: w-retention-period-1629442620182>]
blobs_to_delete = [<Blob: w-retention-period-1629442620182, test-blob, 1629442620932109>]

    def test_bucket_w_retention_period(
        storage_client, buckets_to_delete, blobs_to_delete,
    ):
        period_secs = 10
        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()

        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)

        assert not other.event_based_hold
        assert not other.temporary_hold
        assert isinstance(other.retention_expiration_time, datetime.datetime)

        with pytest.raises(exceptions.Forbidden):
            other.delete()

        bucket.retention_period = None
        bucket.patch()

        assert bucket.retention_period is None
        assert bucket.retention_policy_effective_time is None
        assert not bucket.default_event_based_hold
        assert not bucket.retention_policy_locked

        other.reload()

        assert not other.event_based_hold
        assert not other.temporary_hold
>       assert other.retention_expiration_time is None
E       assert datetime.datetime(2021, 8, 20, 6, 57, 10, 949000, tzinfo=<UTC>) is None
E        +  where datetime.datetime(2021, 8, 20, 6, 57, 10, 949000, tzinfo=<UTC>) = <Blob: w-retention-period-1629442620182, test-blob, 1629442620932109>.retention_expiration_time

tests/system/test_bucket.py:572: AssertionError
Reactions are currently unavailable

Metadata

Metadata

Assignees

Labels

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

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.