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_default_event_based_hold' systest is flaky #435

Closed

Description

@tseaver

From this Kokoro failure:

__________ TestRetentionPolicy.test_bucket_w_default_event_based_hold __________

self = <test_system.TestRetentionPolicy testMethod=test_bucket_w_default_event_based_hold>

    def test_bucket_w_default_event_based_hold(self):
        from google.api_core import exceptions

        new_bucket_name = "w-def-ebh" + unique_resource_id("-")
        self.assertRaises(
            exceptions.NotFound, Config.CLIENT.get_bucket, new_bucket_name
        )
        bucket = retry_429_503(Config.CLIENT.create_bucket)(new_bucket_name)
        self.case_buckets_to_delete.append(new_bucket_name)

        bucket.default_event_based_hold = True
        bucket.patch()

        self.assertTrue(bucket.default_event_based_hold)
        self.assertIsNone(bucket.retention_period)
        self.assertIsNone(bucket.retention_policy_effective_time)
        self.assertFalse(bucket.retention_policy_locked)

        blob_name = "test-blob"
        payload = b"DEADBEEF"
        blob = bucket.blob(blob_name)
        blob.upload_from_string(payload)

        self.case_blobs_to_delete.append(blob)

        other = bucket.get_blob(blob_name)

        self.assertTrue(other.event_based_hold)
        self.assertFalse(other.temporary_hold)
        self.assertIsNone(other.retention_expiration_time)

        with self.assertRaises(exceptions.Forbidden):
            other.delete()

        other.event_based_hold = False
        other.patch()
        other.delete()

        bucket.default_event_based_hold = False
        bucket.patch()

        self.assertFalse(bucket.default_event_based_hold)
        self.assertIsNone(bucket.retention_period)
        self.assertIsNone(bucket.retention_policy_effective_time)
        self.assertFalse(bucket.retention_policy_locked)

        blob.upload_from_string(payload)
>       self.assertFalse(blob.event_based_hold)
E       AssertionError: True is not false

tests/system/test_system.py:2442: AssertionError

Activity

  1. added
    type: processA process-related concern. May include testing, release, or the like.
    flakyflaky systests / samples
    on May 7, 2021
  2. self-assigned this
    on May 7, 2021
  3. added 2 commits that reference this issue on Jun 14, 2021
    ad3a812
    618f480
  4. added a commit that references this issue on Jun 21, 2021
    3b06f9e
  5. tseaver commented on Aug 19, 2021

    @tseaver
    ContributorAuthor

    I'm seeing leaked buckets from this systest, because the blob in them still has its EBH set.

  6. added a commit that references this issue on Aug 19, 2021
    049f48d
  7. added a commit that references this issue on Aug 24, 2021
    e5f2d13
  8. added 4 commits that reference this issue on Oct 13, 2021
    0c7d27f
    2607fdb
    9a622c9
    9a6b2ea
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

api: storageIssues related to the googleapis/python-storage API.flakyflaky systests / samplestestingtype: 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