Skip to content

New test for 'Blob._do_multipart_upload' w/ metadata flakes #309

Closed
@tseaver

Description

@tseaver

The flaky test was introduced in #298

The issue is that the code which constructs the expected payload for the request is flaky given Python's hash randomization:

        blob_data = b'{"name": "blob-name"}\r\n'
        if metadata:
            blob_data = (
                b'{"name": "blob-name", "metadata": '
                + json.dumps(metadata).encode("utf-8")
                + b"}\r\n"
            )
            self.assertEqual(blob._changes, set(["metadata"]))
        payload = (
            b"--==0==\r\n"
            + b"content-type: application/json; charset=UTF-8\r\n\r\n"
            + b'{"name": "blob-name"}\r\n'
            + blob_data
            + b"--==0==\r\n"
            + b"content-type: application/xml\r\n\r\n"
            + data_read

Metadata

Metadata

Assignees

Labels

api: storageIssues related to the googleapis/python-storage API.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.type: 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