Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Storage: 'test_bucket_w_retention_period' flakes with 429 #6244

Closed
tseaver opened this issue Oct 17, 2018 · 3 comments
Closed

Storage: 'test_bucket_w_retention_period' flakes with 429 #6244

tseaver opened this issue Oct 17, 2018 · 3 comments
Assignees
Labels
api: storage Issues related to the Cloud Storage API. flaky testing type: process A process-related concern. May include testing, release, or the like.

Comments

@tseaver
Copy link
Contributor

tseaver commented Oct 17, 2018

From Kokoro today:

______________ TestRetentionPolicy.test_bucket_w_retention_period ______________

self = <tests.system.TestRetentionPolicy testMethod=test_bucket_w_retention_period>

    def test_bucket_w_retention_period(self):
        import datetime
        from google.api_core import exceptions

        period_secs = 10

        new_bucket_name = 'w-retention-period' + unique_resource_id('-')
>       bucket = Config.CLIENT.create_bucket(new_bucket_name)

tests/system.py:1296:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
google/cloud/storage/client.py:285: in create_bucket
    bucket.create(client=self, project=project)
google/cloud/storage/bucket.py:480: in create
    data=properties, _target_object=self)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <google.cloud.storage._http.Connection object at 0x7f99c18a1210>
method = 'POST', path = '/b', query_params = {'project': 'precise-truck-742'}
data = '{"name": "w-retention-period-1539807189922"}'
content_type = 'application/json', headers = None, api_base_url = None
api_version = None, expect_json = True
_target_object = <Bucket: w-retention-period-1539807189922>

    def api_request(self, method, path, query_params=None,
                    data=None, content_type=None, headers=None,
                    api_base_url=None, api_version=None,
                    expect_json=True, _target_object=None):
        ...
        url = self.build_api_url(path=path, query_params=query_params,
                                 api_base_url=api_base_url,
                                 api_version=api_version)

        # Making the executive decision that any dictionary
        # data will be sent properly as JSON.
        if data and isinstance(data, dict):
            data = json.dumps(data)
            content_type = 'application/json'

        response = self._make_request(
            method=method, url=url, data=data, content_type=content_type,
            headers=headers, target_object=_target_object)

        if not 200 <= response.status_code < 300:
>           raise exceptions.from_http_response(response)
E           TooManyRequests: 429 POST https://www.googleapis.com/storage/v1/b?project=precise-truck-742: The project exceeded the rate limit for creating and deleting buckets.

../core/google/cloud/_http.py:293: TooManyRequests
@tseaver tseaver added api: storage Issues related to the Cloud Storage API. testing type: process A process-related concern. May include testing, release, or the like. flaky labels Oct 17, 2018
@tseaver tseaver changed the title Storage: 'TestRetentionPolicy.test_bucket_w_retention_period' flakes with '429 TooManyRequests' Storage: 'test_bucket_w_retention_period' flakes with 429 Oct 17, 2018
@frankyn
Copy link
Member

frankyn commented Nov 5, 2018

Looks like this project needs to be whitelisted as well.

@tseaver could you directly ping me the project id if this is still occurring?

@tseaver
Copy link
Contributor Author

tseaver commented Nov 6, 2018

@frankyn this looks like actual flakiness in the system test: the call to Config.CLIENT.create_bucket needs to be wrapped in a retry_429.

@frankyn
Copy link
Member

frankyn commented Nov 6, 2018

Agreed that it's a flaky failure based on create/delete frequency. Systems tests can have bucket create/delete quota lifted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the Cloud Storage API. flaky testing type: process A process-related concern. May include testing, release, or the like.
Projects
None yet
Development

No branches or pull requests

2 participants