Skip to content

BigQuery: flaky 'test_create_table' snippet. #7846

Closed

Description

@tseaver

From: this test failure:

py.test samples
============================= test session starts ==============================
platform linux -- Python 3.6.0, pytest-4.4.1, py-1.8.0, pluggy-0.9.0
rootdir: /tmpfs/src/github/google-cloud-python/bigquery
collected 12 items
samples/tests/test_create_dataset.py .                                   [  8%]
samples/tests/test_create_table.py E                                     [ 16%]
samples/tests/test_delete_dataset.py .                                   [ 25%]
samples/tests/test_delete_table.py .                                     [ 33%]
samples/tests/test_get_dataset.py .                                      [ 41%]
samples/tests/test_get_table.py .                                        [ 50%]
samples/tests/test_list_datasets.py .                                    [ 58%]
samples/tests/test_list_tables.py .                                      [ 66%]
samples/tests/test_model_samples.py .                                    [ 75%]
samples/tests/test_update_dataset_access.py .                            [ 83%]
samples/tests/test_update_dataset_default_table_expiration.py .          [ 91%]
samples/tests/test_update_dataset_description.py .                       [100%]
==================================== ERRORS ====================================
_____________________ ERROR at setup of test_create_table ______________________
client = <google.cloud.bigquery.client.Client object at 0x7f9d84a7be10>
    @pytest.fixture
    def dataset_id(client):
        now = datetime.datetime.now()
        dataset_id = "python_samples_{}_{}".format(
            now.strftime("%Y%m%d%H%M%S"), uuid.uuid4().hex[:8]
        )
>       dataset = client.create_dataset(dataset_id)
samples/tests/conftest.py:53:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
google/cloud/bigquery/client.py:364: in create_dataset
    api_response = self._call_api(retry, method="POST", path=path, data=data)
google/cloud/bigquery/client.py:413: in _call_api
    return call()
../api_core/google/api_core/retry.py:270: in retry_wrapped_func
    on_error=on_error,
../api_core/google/api_core/retry.py:179: in retry_target
    return target()
../core/google/cloud/_http.py:315: in api_request
    target_object=_target_object,
../core/google/cloud/_http.py:192: in _make_request
    return self._do_request(method, url, headers, data, target_object)
../core/google/cloud/_http.py:221: in _do_request
    return self.http.request(url=url, method=method, headers=headers, data=data)
.nox/snippets-3-6/lib/python3.6/site-packages/google/auth/transport/requests.py:205: in request
    self._auth_request, method, url, request_headers)
.nox/snippets-3-6/lib/python3.6/site-packages/google/auth/credentials.py:122: in before_request
    self.refresh(request)
.nox/snippets-3-6/lib/python3.6/site-packages/google/oauth2/service_account.py:322: in refresh
    request, self._token_uri, assertion)
.nox/snippets-3-6/lib/python3.6/site-packages/google/oauth2/_client.py:145: in jwt_grant
    response_data = _token_endpoint_request(request, token_uri, body)
.nox/snippets-3-6/lib/python3.6/site-packages/google/oauth2/_client.py:111: in _token_endpoint_request
    _handle_error_response(response_body)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
response_body = '{\n  "error": "internal_failure"\n}'
    def _handle_error_response(response_body):
        """"Translates an error response into an exception.
        Args:
            response_body (str): The decoded response data.
        Raises:
            google.auth.exceptions.RefreshError
        """
        try:
            error_data = json.loads(response_body)
            error_details = '{}: {}'.format(
                error_data['error'],
                error_data.get('error_description'))
        # If no details could be extracted, use the response data.
        except (KeyError, ValueError):
            error_details = response_body
        raise exceptions.RefreshError(
>           error_details, response_body)
E       google.auth.exceptions.RefreshError: ('internal_failure: None', '{\n  "error": "internal_failure"\n}')
.nox/snippets-3-6/lib/python3.6/site-packages/google/oauth2/_client.py:61: RefreshError
===================== 11 passed, 1 error in 32.84 seconds ======================

Activity

  1. added
    api: bigquery
    type: process
    on May 2, 2019
  2. emar-kar commented on Sep 23, 2019

    @emar-kar
    Contributor

    Hello. I ran this test for 100000 times on the weekends. Nevertheless, I didn't catch this error. I assume it could be the one-time backend problem.
    test_create_table
    test_create_table2

  3. tseaver commented on Oct 4, 2019

    @tseaver
    ContributorAuthor

    Transient backend failure in getting an auth token: not an "expected error" for us to handle in our systests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

api: bigqueryflakytestingtype: process

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions