googleapis / python-compute

This library has moved to https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-compute
Apache License 2.0
39 stars 26 forks source link

tests.system.test_smoke.TestComputeSmoke: test_update_description_non_ascii failed #437

Closed flaky-bot[bot] closed 1 year ago

flaky-bot[bot] commented 1 year ago

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


commit: 81430c1973c10969500b5dd6704ee0c38e314e71 buildURL: Build Status, Sponge status: failed

Test output
self = 

    def test_update_description_non_ascii(self):
        self.insert_instance()
        instance = self.get_instance()
        self.assertEqual(instance.description, "test")
        instance.description = "тест"
>       update_op = self.client.update_unary(
            project=self.DEFAULT_PROJECT,
            zone=self.DEFAULT_ZONE,
            instance=self.name,
            instance_resource=instance,
        )

tests/system/test_smoke.py:155: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
google/cloud/compute_v1/services/instances/client.py:10924: in update_unary
    response = rpc(
.nox/system-3-8/lib/python3.8/site-packages/google/api_core/gapic_v1/method.py:113: in __call__
    return wrapped_func(*args, **kwargs)
.nox/system-3-8/lib/python3.8/site-packages/google/api_core/grpc_helpers.py:72: in error_remapped_callable
    return callable_(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = InstancesRestTransport._Update(_session=, _...rceptor=)
request = instance: "gapicinstance1f766b038806470a996a915e8f1618e3"
instance_resource {
  cpu_platform: "Intel Haswell"
  creati...is.com/compute/v1/projects/precise-truck-742/zones/us-central1-a"
}
project: "precise-truck-742"
zone: "us-central1-a"

    def __call__(
        self,
        request: compute.UpdateInstanceRequest,
        *,
        retry: OptionalRetry = gapic_v1.method.DEFAULT,
        timeout: Optional[float] = None,
        metadata: Sequence[Tuple[str, str]] = (),
    ) -> compute.Operation:
        r"""Call the update method over HTTP.

        Args:
            request (~.compute.UpdateInstanceRequest):
                The request object. A request message for
            Instances.Update. See the method
            description for details.
            retry (google.api_core.retry.Retry): Designation of what errors, if any,
                should be retried.
            timeout (float): The timeout for this request.
            metadata (Sequence[Tuple[str, str]]): Strings which should be
                sent along with the request as metadata.

        Returns:
            ~.compute.Operation:
                Represents an Operation resource. Google Compute Engine
            has three Operation resources: \*
            `Global `__
            \*
            `Regional `__
            \*
            `Zonal `__
            You can use an operation resource to manage asynchronous
            API requests. For more information, read Handling API
            responses. Operations can be global, regional or zonal.
            - For global operations, use the ``globalOperations``
            resource. - For regional operations, use the
            ``regionOperations`` resource. - For zonal operations,
            use the ``zonalOperations`` resource. For more
            information, read Global, Regional, and Zonal Resources.

        """

        http_options: List[Dict[str, str]] = [
            {
                "method": "put",
                "uri": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}",
                "body": "instance_resource",
            },
        ]
        request, metadata = self._interceptor.pre_update(request, metadata)
        pb_request = compute.UpdateInstanceRequest.pb(request)
        transcoded_request = path_template.transcode(http_options, pb_request)

        # Jsonify the request body

        body = json_format.MessageToJson(
            transcoded_request["body"],
            including_default_value_fields=False,
            use_integers_for_enums=False,
        )
        uri = transcoded_request["uri"]
        method = transcoded_request["method"]

        # Jsonify the query params
        query_params = json.loads(
            json_format.MessageToJson(
                transcoded_request["query_params"],
                including_default_value_fields=False,
                use_integers_for_enums=False,
            )
        )
        query_params.update(self._get_unset_required_fields(query_params))

        # Send the request
        headers = dict(metadata)
        headers["Content-Type"] = "application/json"
        response = getattr(self._session, method)(
            "{host}{uri}".format(host=self._host, uri=uri),
            timeout=timeout,
            headers=headers,
            params=rest_helpers.flatten_query_params(query_params, strict=True),
            data=body,
        )

        # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception
        # subclass.
        if response.status_code >= 400:
>           raise core_exceptions.from_http_response(response)
E           google.api_core.exceptions.BadRequest: 400 PUT https://compute.googleapis.com/compute/v1/projects/precise-truck-742/zones/us-central1-a/instances/gapicinstance1f766b038806470a996a915e8f1618e3: Invalid value for field 'resource.fingerprint': ''. Fingerprint mismatch, some instance properties may have changed or you are using a different API version to get the instance resource.

google/cloud/compute_v1/services/instances/transports/rest.py:5927: BadRequest
flaky-bot[bot] commented 1 year ago

Looks like this issue is flaky. :worried:

I'm going to leave this open and stop commenting.

A human should fix and close this.


When run at the same commit (81430c1973c10969500b5dd6704ee0c38e314e71), this test passed in one build (Build Status, Sponge) and failed in another build (Build Status, Sponge).

parthea commented 1 year ago

Closing as obsolete