Skip to content

BigQuery: flaky 'test_create_table' snippet. #7846

@tseaver

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 ======================

Metadata

Metadata

Assignees

Labels

api: bigqueryIssues related to the BigQuery API.flakytestingtype: 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