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.

tests.system.test_fileio: test_blobwriter_and_blobreader failed #1150

@flaky-bot

Description

@flaky-bot

Note: #963 was also for this test, but it was closed more than 10 days ago. So, I didn't mark it flaky.


commit: a3a1159
buildURL: Build Status, Sponge
status: failed

Test output
shared_bucket = , blobs_to_delete = []
file_data = {'big': {'hash': b'cEome4a+NYd7YIXzXQnR5Q==', 'path': '/tmpfs/src/github/python-storage/tests/data/five-point-one-mb-f...g'}, 'simple': {'hash': b'3Hkwjv2WvCnKjNR6Z3CboA==', 'path': '/tmpfs/src/github/python-storage/tests/data/simple.txt'}}
service_account = 
def test_blobwriter_and_blobreader(
    shared_bucket,
    blobs_to_delete,
    file_data,
    service_account,
):
    blob = shared_bucket.blob("LargeFile")

    # Test BlobWriter works.
    info = file_data["big"]
    with open(info["path"], "rb") as file_obj:
        with blob.open("wb", chunk_size=256 * 1024) as writer:
            writer.write(file_obj.read(100))
          writer.write(file_obj.read(256 * 1024))

tests/system/test_fileio.py:33:


google/cloud/storage/fileio.py:357: in write
self._upload_chunks_from_buffer(num_chunks)
google/cloud/storage/fileio.py:405: in _upload_chunks_from_buffer
self._initiate_upload()
google/cloud/storage/fileio.py:389: in _initiate_upload
self._upload_and_transport = self._blob._initiate_resumable_upload(
google/cloud/storage/blob.py:2117: in _initiate_resumable_upload
upload.initiate(
.nox/system-3-8/lib/python3.8/site-packages/google/resumable_media/requests/upload.py:420: in initiate
return _request_helpers.wait_and_retry(
.nox/system-3-8/lib/python3.8/site-packages/google/resumable_media/requests/_request_helpers.py:178: in wait_and_retry
raise error
.nox/system-3-8/lib/python3.8/site-packages/google/resumable_media/requests/_request_helpers.py:155: in wait_and_retry
response = func()
.nox/system-3-8/lib/python3.8/site-packages/google/resumable_media/requests/upload.py:416: in retriable_request
self._process_initiate_response(result)
.nox/system-3-8/lib/python3.8/site-packages/google/resumable_media/_upload.py:518: in _process_initiate_response
_helpers.require_status_code(


response = <Response [503]>
status_codes = (<HTTPStatus.OK: 200>, <HTTPStatus.CREATED: 201>)
get_status_code = <function RequestsMixin._get_status_code at 0x7f1d97565040>
callback = <bound method ResumableUpload._make_invalid of <google.resumable_media.requests.upload.ResumableUpload object at 0x7f1d956a8310>>

def require_status_code(response, status_codes, get_status_code, callback=do_nothing):
    """Require a response has a status code among a list.

    Args:
        response (object): The HTTP response object.
        status_codes (tuple): The acceptable status codes.
        get_status_code (Callable[Any, int]): Helper to get a status code
            from a response.
        callback (Optional[Callable]): A callback that takes no arguments,
            to be executed when an exception is being raised.

    Returns:
        int: The status code.

    Raises:
        ~google.resumable_media.common.InvalidResponse: If the status code
            is not one of the values in ``status_codes``.
    """
    status_code = get_status_code(response)
    if status_code not in status_codes:
        if status_code not in common.RETRYABLE:
            callback()
      raise common.InvalidResponse(
            response,
            "Request failed with status code",
            status_code,
            "Expected one of",
            *status_codes
        )

E google.resumable_media.common.InvalidResponse: ('Request failed with status code', 503, 'Expected one of', <HTTPStatus.OK: 200>, <HTTPStatus.CREATED: 201>)

.nox/system-3-8/lib/python3.8/site-packages/google/resumable_media/_helpers.py:108: InvalidResponse

During handling of the above exception, another exception occurred:

shared_bucket = <Bucket: gcp-systest-1696869300933>, blobs_to_delete = []
file_data = {'big': {'hash': b'cEome4a+NYd7YIXzXQnR5Q==', 'path': '/tmpfs/src/github/python-storage/tests/data/five-point-one-mb-f...g'}, 'simple': {'hash': b'3Hkwjv2WvCnKjNR6Z3CboA==', 'path': '/tmpfs/src/github/python-storage/tests/data/simple.txt'}}
service_account = <google.oauth2.service_account.Credentials object at 0x7f1d97209430>

def test_blobwriter_and_blobreader(
    shared_bucket,
    blobs_to_delete,
    file_data,
    service_account,
):
    blob = shared_bucket.blob("LargeFile")

    # Test BlobWriter works.
    info = file_data["big"]
    with open(info["path"], "rb") as file_obj:
        with blob.open("wb", chunk_size=256 * 1024) as writer:
            writer.write(file_obj.read(100))
            writer.write(file_obj.read(256 * 1024))
          writer.write(file_obj.read())

tests/system/test_fileio.py:34:


google/cloud/storage/fileio.py:431: in close
self._upload_chunks_from_buffer(1)
google/cloud/storage/fileio.py:405: in _upload_chunks_from_buffer
self._initiate_upload()
google/cloud/storage/fileio.py:389: in _initiate_upload
self._upload_and_transport = self._blob._initiate_resumable_upload(
google/cloud/storage/blob.py:2117: in _initiate_resumable_upload
upload.initiate(
.nox/system-3-8/lib/python3.8/site-packages/google/resumable_media/requests/upload.py:420: in initiate
return _request_helpers.wait_and_retry(
.nox/system-3-8/lib/python3.8/site-packages/google/resumable_media/requests/_request_helpers.py:178: in wait_and_retry
raise error
.nox/system-3-8/lib/python3.8/site-packages/google/resumable_media/requests/_request_helpers.py:155: in wait_and_retry
response = func()
.nox/system-3-8/lib/python3.8/site-packages/google/resumable_media/requests/upload.py:416: in retriable_request
self._process_initiate_response(result)
.nox/system-3-8/lib/python3.8/site-packages/google/resumable_media/_upload.py:518: in _process_initiate_response
_helpers.require_status_code(


response = <Response [503]>
status_codes = (<HTTPStatus.OK: 200>, <HTTPStatus.CREATED: 201>)
get_status_code = <function RequestsMixin._get_status_code at 0x7f1d97565040>
callback = <bound method ResumableUpload._make_invalid of <google.resumable_media.requests.upload.ResumableUpload object at 0x7f1d956a8130>>

def require_status_code(response, status_codes, get_status_code, callback=do_nothing):
    """Require a response has a status code among a list.

    Args:
        response (object): The HTTP response object.
        status_codes (tuple): The acceptable status codes.
        get_status_code (Callable[Any, int]): Helper to get a status code
            from a response.
        callback (Optional[Callable]): A callback that takes no arguments,
            to be executed when an exception is being raised.

    Returns:
        int: The status code.

    Raises:
        ~google.resumable_media.common.InvalidResponse: If the status code
            is not one of the values in ``status_codes``.
    """
    status_code = get_status_code(response)
    if status_code not in status_codes:
        if status_code not in common.RETRYABLE:
            callback()
      raise common.InvalidResponse(
            response,
            "Request failed with status code",
            status_code,
            "Expected one of",
            *status_codes
        )

E google.resumable_media.common.InvalidResponse: ('Request failed with status code', 503, 'Expected one of', <HTTPStatus.OK: 200>, <HTTPStatus.CREATED: 201>)

.nox/system-3-8/lib/python3.8/site-packages/google/resumable_media/_helpers.py:108: InvalidResponse

Metadata

Metadata

Assignees

No one assigned

    Labels

    api: storageIssues related to the googleapis/python-storage API.flakybot: issueAn issue filed by the Flaky Bot. Should not be added manually.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions