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_patch failed #407

Closed flaky-bot[bot] closed 1 year ago

flaky-bot[bot] commented 1 year ago

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


commit: 4c44d1930bce2e9599c7f86f55b94c7125c79a19 buildURL: Build Status, Sponge status: failed

Test output
self = 

    def test_patch(self):
        self.insert_instance()
        instance = self.get_instance()
        self.assertEqual(instance.shielded_instance_config.enable_secure_boot, False)
        op = self.client.stop_unary(
            project=self.DEFAULT_PROJECT, zone=self.DEFAULT_ZONE, instance=self.name
        )
>       self.wait_for_zonal_operation(op.name)

tests/system/test_smoke.py:97: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/system/base.py:52: in wait_for_zonal_operation
    result = client.wait(
google/cloud/compute_v1/services/zone_operations/client.py:851: in wait
    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 = ZoneOperationsRestTransport._Wait(_session=...ogle.cloud.compute_v1.services.zone_operations.transports.rest.ZoneOperationsRestInterceptor object at 0x7f8c146f1af0>)
request = operation: "operation-1681853379232-5f9a3013bc47c-9ffed91c-d2c11452"
project: "precise-truck-742"
zone: "us-central1-a"

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

        Args:
            request (~.compute.WaitZoneOperationRequest):
                The request object. A request message for
            ZoneOperations.Wait. 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": "post",
                "uri": "/compute/v1/projects/{project}/zones/{zone}/operations/{operation}/wait",
            },
        ]
        request, metadata = self._interceptor.pre_wait(request, metadata)
        pb_request = compute.WaitZoneOperationRequest.pb(request)
        transcoded_request = path_template.transcode(http_options, pb_request)

        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),
        )

        # 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.ServiceUnavailable: 503 POST https://compute.googleapis.com/compute/v1/projects/precise-truck-742/zones/us-central1-a/operations/operation-1681853379232-5f9a3013bc47c-9ffed91c-d2c11452/wait: Internal error. Please try again or contact Google Support. (Code: '5F9A30144C698.6E6536A.D90D18D8')

google/cloud/compute_v1/services/zone_operations/transports/rest.py:663: ServiceUnavailable
parthea commented 1 year ago

Same as https://github.com/googleapis/python-compute/issues/396#issuecomment-1451070016