GoogleCloudPlatform / python-docs-samples

Code samples used on cloud.google.com
Apache License 2.0
7.34k stars 6.39k forks source link

cloudiot_mqtt_example_test: test_receive_command failed #4254

Closed flaky-bot[bot] closed 4 years ago

flaky-bot[bot] commented 4 years ago

This test failed!

To configure my behavior, see the Build Cop Bot documentation.

If I'm commenting on this issue too often, add the buildcop: quiet label and I will stop commenting.


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

Test output
args = (name: "projects/python-docs-samples-tests/locations/us-central1/registries/test-registry-877f7f3bbb964067bf159baf78571669-1594121849/devices/test-device-RSA256"
binary_data: "me want cookies"
,)
kwargs = {'metadata': [('x-goog-request-params', 'name=projects/python-docs-samples-tests/locations/us-central1/registries/test...es/test-device-RSA256'), ('x-goog-api-client', 'gl-python/3.8.3 grpc/1.30.0 gax/1.21.0 gapic/1.0.0')], 'timeout': 20.0}

    @six.wraps(callable_)
    def error_remapped_callable(*args, **kwargs):
        try:
>           return callable_(*args, **kwargs)

.nox/py-3-8/lib/python3.8/site-packages/google/api_core/grpc_helpers.py:57: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = 
request = name: "projects/python-docs-samples-tests/locations/us-central1/registries/test-registry-877f7f3bbb964067bf159baf78571669-1594121849/devices/test-device-RSA256"
binary_data: "me want cookies"

timeout = 20.0
metadata = [('x-goog-request-params', 'name=projects/python-docs-samples-tests/locations/us-central1/registries/test-registry-877...9-1594121849/devices/test-device-RSA256'), ('x-goog-api-client', 'gl-python/3.8.3 grpc/1.30.0 gax/1.21.0 gapic/1.0.0')]
credentials = None, wait_for_ready = None, compression = None

    def __call__(self,
                 request,
                 timeout=None,
                 metadata=None,
                 credentials=None,
                 wait_for_ready=None,
                 compression=None):
        state, call, = self._blocking(request, timeout, metadata, credentials,
                                      wait_for_ready, compression)
>       return _end_unary_response_blocking(state, call, False, None)

.nox/py-3-8/lib/python3.8/site-packages/grpc/_channel.py:826: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

state = 
call = 
with_call = False, deadline = None

    def _end_unary_response_blocking(state, call, with_call, deadline):
        if state.code is grpc.StatusCode.OK:
            if with_call:
                rendezvous = _MultiThreadedRendezvous(state, call, None, deadline)
                return state.response, rendezvous
            else:
                return state.response
        else:
>           raise _InactiveRpcError(state)
E           grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
E               status = StatusCode.FAILED_PRECONDITION
E               details = "Device `2607729675582124` is not subscribed to the commands topic."
E               debug_error_string = "{"created":"@1594121917.861581590","description":"Error received from peer ipv4:74.125.195.95:443","file":"src/core/lib/surface/call.cc","file_line":1055,"grpc_message":"Device `2607729675582124` is not subscribed to the commands topic.","grpc_status":9}"
E           >

.nox/py-3-8/lib/python3.8/site-packages/grpc/_channel.py:729: _InactiveRpcError

The above exception was the direct cause of the following exception:

test_registry_id = 'test-registry-877f7f3bbb964067bf159baf78571669-1594121849'
test_device_id = 'test-device-RSA256'
capsys = <_pytest.capture.CaptureFixture object at 0x7f76a629ffa0>

    @pytest.mark.flaky(max_runs=5, min_passes=1)
    def test_receive_command(test_registry_id, test_device_id, capsys): # noqa
        # Exercize the functionality
        client = cloudiot_mqtt_example.get_client(
            project_id, cloud_region, test_registry_id, test_device_id,
            rsa_private_path, 'RS256', ca_cert_path,
            'mqtt.googleapis.com', 443)
        client.loop_start()

        # Pre-process commands
        for i in range(1, 5):
            client.loop()
            time.sleep(1)

>       manager.send_command(
                service_account_json, project_id, cloud_region, test_registry_id,
                test_device_id, 'me want cookies')

cloudiot_mqtt_example_test.py:133: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../manager/manager.py:624: in send_command
    return client.send_command_to_device(device_path, data)
.nox/py-3-8/lib/python3.8/site-packages/google/cloud/iot_v1/gapic/device_manager_client.py:1673: in send_command_to_device
    return self._inner_api_calls["send_command_to_device"](
.nox/py-3-8/lib/python3.8/site-packages/google/api_core/gapic_v1/method.py:143: in __call__
    return wrapped_func(*args, **kwargs)
.nox/py-3-8/lib/python3.8/site-packages/google/api_core/retry.py:281: in retry_wrapped_func
    return retry_target(
.nox/py-3-8/lib/python3.8/site-packages/google/api_core/retry.py:184: in retry_target
    return target()
.nox/py-3-8/lib/python3.8/site-packages/google/api_core/timeout.py:214: in func_with_timeout
    return func(*args, **kwargs)
.nox/py-3-8/lib/python3.8/site-packages/google/api_core/grpc_helpers.py:59: in error_remapped_callable
    six.raise_from(exceptions.from_grpc_error(exc), exc)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

value = None
from_value = <_InactiveRpcError of RPC that terminated with:
    status = StatusCode.FAILED_PRECONDITION
    details = "Device `260772967...file_line":1055,"grpc_message":"Device `2607729675582124` is not subscribed to the commands topic.","grpc_status":9}"
>

>   ???
E   google.api_core.exceptions.FailedPrecondition: 400 Device `2607729675582124` is not subscribed to the commands topic.

:3: FailedPrecondition
flaky-bot[bot] commented 4 years ago

Test passed for commit a65c3cd66b23f1457cca6a6c1de1b1a9a977111a (Build Status, Sponge)! Closing this issue.