@@ -193,8 +193,9 @@ shadow_types = parallel ? [:named] : [:named, :unnamed]
193193 try
194194 fetch (publish (sc, " /delete" , " " , AWS_MQTT_QOS_AT_LEAST_ONCE)[1 ]) # ensure the shadow is deleted just in case of a prior broken test
195195
196- fetch (subscribe (sf)[1 ]) # subscribe and trigger the initial update, which will fail because there is no shadow
197- wait_until_synced (sf)
196+ wait_until_synced (sf) do
197+ fetch (subscribe (sf)[1 ]) # subscribe and trigger the initial update, which will fail because there is no shadow
198+ end
198199 sleep (3 ) # we need to make sure the local shadow won't get modified. no better way than to just wait a bit in case something modifies it.
199200 @test collect (keys (doc)) == [" version" , " foo" ] # we should have the version and the initial foo key we set
200201 @test doc[" foo" ] == 1 # should be unchanged from our initial state
@@ -241,8 +242,9 @@ shadow_types = parallel ? [:named] : [:named, :unnamed]
241242
242243 @info " subscribing in band shadow"
243244 values_post_update = []
244- fetch (subscribe (sf)[1 ]) # subscribe and trigger the initial update
245- wait_until_synced (sf)
245+ wait_until_synced (sf) do
246+ fetch (subscribe (sf)[1 ]) # subscribe and trigger the initial update
247+ end
246248 wait_for (() -> length (values_post_update) >= 1 ) # wait for the update to finish since it requires multiple messages
247249 # The initial update should have pulled in that desired state
248250 @test doc[" foo" ] == 2
@@ -425,10 +427,11 @@ end
425427
426428 try
427429 @info " subscribing"
428- fetch (subscribe (sf)[1 ])
429430 # wait for the first publish to finish, otherwise we will race it with our next update, which could arrive
430431 # first and break this test
431- wait_until_synced (sf)
432+ wait_until_synced (sf) do
433+ fetch (subscribe (sf)[1 ])
434+ end
432435
433436 # publish a /update. this should be accepted. the local shadow should be updated.
434437 # an /update should be published with the new reported state.
@@ -516,10 +519,11 @@ end
516519
517520 try
518521 @info " subscribing"
519- fetch (subscribe (sf)[1 ])
520522 # wait for the first publish to finish, otherwise we will race it with our next update, which could arrive
521523 # first and break this test
522- wait_until_synced (sf)
524+ wait_until_synced (sf) do
525+ fetch (subscribe (sf)[1 ])
526+ end
523527
524528 # publish an /update which adds bar=1. this should be rejected because bar is not present in the struct.
525529 # the local shadow should not be updated. an /update should not be published.
0 commit comments