From 5f6be49c20c9423654b1a57b79bd357da240eaac Mon Sep 17 00:00:00 2001 From: Dengke Tang <815825145@qq.com> Date: Tue, 4 Aug 2020 16:33:22 -0700 Subject: [PATCH] update submodules to latest pre-release (#170) update submodules to latest pre-release Co-authored-by: Dengke Tang --- aws-common-runtime/aws-c-auth | 2 +- aws-common-runtime/aws-c-common | 2 +- aws-common-runtime/aws-c-http | 2 +- aws-common-runtime/aws-c-io | 2 +- aws-common-runtime/aws-c-mqtt | 2 +- source/mqtt_client_connection.c | 6 +----- test/test_mqtt.py | 17 ++++++++++++++++- 7 files changed, 22 insertions(+), 11 deletions(-) diff --git a/aws-common-runtime/aws-c-auth b/aws-common-runtime/aws-c-auth index 3d23c1c44..87355de67 160000 --- a/aws-common-runtime/aws-c-auth +++ b/aws-common-runtime/aws-c-auth @@ -1 +1 @@ -Subproject commit 3d23c1c44077dded5ee069bcf5d7c5c9e6ee280e +Subproject commit 87355de67efe4077a8630125196ada3338e1c295 diff --git a/aws-common-runtime/aws-c-common b/aws-common-runtime/aws-c-common index f6f914598..9b0b45b18 160000 --- a/aws-common-runtime/aws-c-common +++ b/aws-common-runtime/aws-c-common @@ -1 +1 @@ -Subproject commit f6f9145982f60ce2c92f9f0f2796b1b150e6f991 +Subproject commit 9b0b45b18ee588fef2ed0f0755e3cd3e02553971 diff --git a/aws-common-runtime/aws-c-http b/aws-common-runtime/aws-c-http index b53100ee4..b5587a87a 160000 --- a/aws-common-runtime/aws-c-http +++ b/aws-common-runtime/aws-c-http @@ -1 +1 @@ -Subproject commit b53100ee427a3618c1692e7ca8aaa1f2cbeb4109 +Subproject commit b5587a87ac942eb6ff5653f4b4b1ca958cbe6b68 diff --git a/aws-common-runtime/aws-c-io b/aws-common-runtime/aws-c-io index cf9dbd744..1cacfb24b 160000 --- a/aws-common-runtime/aws-c-io +++ b/aws-common-runtime/aws-c-io @@ -1 +1 @@ -Subproject commit cf9dbd744f56eccc00bd3f9c4e7ba283949e1a28 +Subproject commit 1cacfb24befb995e466fc1271e845ab594c6e392 diff --git a/aws-common-runtime/aws-c-mqtt b/aws-common-runtime/aws-c-mqtt index 45e054d19..c334aa5ab 160000 --- a/aws-common-runtime/aws-c-mqtt +++ b/aws-common-runtime/aws-c-mqtt @@ -1 +1 @@ -Subproject commit 45e054d191ef3d40305d934ff95c32adf44edc7c +Subproject commit c334aa5abbab072c6ce14859ede371b2c4be6cc9 diff --git a/source/mqtt_client_connection.c b/source/mqtt_client_connection.c index 3519f6707..eded0e8e0 100644 --- a/source/mqtt_client_connection.c +++ b/source/mqtt_client_connection.c @@ -1096,12 +1096,8 @@ PyObject *aws_py_mqtt_client_connection_resubscribe_existing_topics(PyObject *se /* C will not be invoking the python callback */ Py_DECREF(suback_callback); - /* Don't raise a Python exception if error is AWS_ERROR_MQTT_NO_TOPICS_FOR_RESUBSCRIBE. - * This is a harmless error, we'll just return None instead of a msg_id */ int aws_err = aws_last_error(); - if (aws_err == AWS_ERROR_MQTT_NO_TOPICS_FOR_RESUBSCRIBE) { - Py_RETURN_NONE; - } else { + if (aws_err) { PyErr_SetAwsLastError(); return NULL; } diff --git a/test/test_mqtt.py b/test/test_mqtt.py index 0a7d1d2b1..eb14af6be 100644 --- a/test/test_mqtt.py +++ b/test/test_mqtt.py @@ -143,14 +143,29 @@ def on_message(**kwargs): connection.disconnect().result(TIMEOUT) def test_on_message(self): - connection = self._test_connection() + config = Config.get() + elg = EventLoopGroup() + resolver = DefaultHostResolver(elg) + bootstrap = ClientBootstrap(elg, resolver) + + tls_opts = TlsContextOptions.create_client_with_mtls(config.cert, config.key) + tls = ClientTlsContext(tls_opts) + + client = Client(bootstrap, tls) + connection = Connection( + client=client, + client_id=create_client_id(), + host_name=config.endpoint, + port=8883) received = Future() def on_message(**kwargs): received.set_result(kwargs) + # on_message for connection has to be set before connect, or possible race will happen connection.on_message(on_message) + connection.connect().result(TIMEOUT) # subscribe without callback subscribed, packet_id = connection.subscribe(self.TEST_TOPIC, QoS.AT_LEAST_ONCE) subscribed.result(TIMEOUT)