Skip to content

Commit

Permalink
Edit trigger engine test
Browse files Browse the repository at this point in the history
Edit trigger engine test with a workaround to assure 100% success rate for async tests

Signed-off-by: Eddy Babetto <[email protected]>
  • Loading branch information
eddbbt committed Mar 13, 2024
1 parent c17ee3a commit 5aa96a7
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ defmodule Astarte.TriggerEngine.AMQPConsumer.AMQPConsumerTrackerTest do

# make sure we update the consumer list without waiting for the update timeout
AMQPConsumerTracker.handle_info(:update_consumers, [])
Process.sleep(3000)

assert Enum.member?(
Registry.select(Registry.AMQPConsumerRegistry, [{{:"$1", :_, :_}, [], [:"$1"]}]),
Expand All @@ -93,6 +94,7 @@ defmodule Astarte.TriggerEngine.AMQPConsumer.AMQPConsumerTrackerTest do

# make sure we update the consumer list without waiting for the update timeout
AMQPConsumerTracker.handle_info(:update_consumers, [])
Process.sleep(3000)

assert not Enum.member?(
Registry.select(Registry.AMQPConsumerRegistry, [{{:"$1", :_, :_}, [], [:"$1"]}]),
Expand Down

0 comments on commit 5aa96a7

Please sign in to comment.