Skip to content

Commit

Permalink
Merge branch 'main' into cmake-modules
Browse files Browse the repository at this point in the history
  • Loading branch information
sfodagain committed Jan 29, 2025
2 parents 21345ce + f2f9b6c commit d288cd5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- 'docs'

env:
BUILDER_VERSION: v0.9.67
BUILDER_VERSION: v0.9.74
BUILDER_SOURCE: releases
BUILDER_HOST: https://d19elf31gohf1l.cloudfront.net
PACKAGE_NAME: aws-crt-python
Expand Down Expand Up @@ -42,7 +42,7 @@ jobs:
./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-manylinux1-${{ matrix.image }} build -p ${{ env.PACKAGE_NAME }} --python /opt/python/${{ matrix.python }}/bin/python
manylinux2014:
runs-on: ubuntu-20.04 # latest
runs-on: ubuntu-22.04 # latest
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -137,7 +137,6 @@ jobs:
strategy:
matrix:
image:
- al2-x64
- fedora-34-x64
- opensuse-leap
- rhel8-x64
Expand Down
11 changes: 10 additions & 1 deletion test/test_mqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,16 @@ def on_message(**kwargs):
ping_timeout_ms=10000,
keep_alive_secs=30
)
disconnecter.connect().result(TIMEOUT)

# A race condition exists in IoT Core where the interrupter may get refused rather than the existing
# connection getting dropped. Loop until we successfully connect.
continue_connecting = True
while continue_connecting:
try:
disconnecter.connect().result(TIMEOUT)
continue_connecting = False
except BaseException:
pass

# Receive message
rcv = received.result(TIMEOUT)
Expand Down
9 changes: 3 additions & 6 deletions test/test_mqtt5.py
Original file line number Diff line number Diff line change
Expand Up @@ -1009,8 +1009,6 @@ def test_operation_sub_unsub(self):
client.stop()
callbacks.future_stopped.result(TIMEOUT)

sub1_callbacks = False
sub2_callbacks = False
total_callbacks = 0
all_packets_received = Future()
mutex = Lock()
Expand All @@ -1020,7 +1018,6 @@ def subscriber1_callback(self, publish_received_data: mqtt5.PublishReceivedData)
self.mutex.acquire()
var = publish_received_data.publish_packet.payload
self.received_subscriptions[int(var)] = 1
self.sub1_callbacks = True
self.total_callbacks = self.total_callbacks + 1
if self.total_callbacks == 10:
self.all_packets_received.set_result(None)
Expand All @@ -1030,7 +1027,6 @@ def subscriber2_callback(self, publish_received_data: mqtt5.PublishReceivedData)
self.mutex.acquire()
var = publish_received_data.publish_packet.payload
self.received_subscriptions[int(var)] = 1
self.sub2_callbacks = True
self.total_callbacks = self.total_callbacks + 1
if self.total_callbacks == 10:
self.all_packets_received.set_result(None)
Expand Down Expand Up @@ -1154,8 +1150,6 @@ def test_operation_shared_subscription(self):
unsuback_packet = unsubscribe_future.result(TIMEOUT)
self.assertIsInstance(unsuback_packet, mqtt5.UnsubackPacket)

self.assertEqual(self.sub1_callbacks, True)
self.assertEqual(self.sub2_callbacks, True)
self.assertEqual(self.total_callbacks, 10)

for e in self.received_subscriptions:
Expand Down Expand Up @@ -1221,6 +1215,9 @@ def test_operation_will(self):
suback_packet = subscribe_future.result(TIMEOUT)
self.assertIsInstance(suback_packet, mqtt5.SubackPacket)

# wait a few seconds to minimize chance of eventual consistency race condition between subscribe and publish
time.sleep(2)

disconnect_packet = mqtt5.DisconnectPacket(reason_code=mqtt5.DisconnectReasonCode.DISCONNECT_WITH_WILL_MESSAGE)
client1.stop(disconnect_packet=disconnect_packet)
callbacks1.future_stopped.result(TIMEOUT)
Expand Down

0 comments on commit d288cd5

Please sign in to comment.