Skip to content

Commit

Permalink
Edit trigger_engine tests
Browse files Browse the repository at this point in the history
Fix trigger_engine amqp_consumer tracker tests adding a sleep before checks
Resolves registry not found that sometimes used to arise, caused by an amqp delay

Signed-off-by: Eddy Babetto <eddy.babetto@secomind.com>
  • Loading branch information
eddbbt committed Nov 22, 2024
1 parent da64066 commit 32e1510
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 32e1510

Please sign in to comment.