diff --git a/.travis.yml b/.travis.yml index 3a18d7f..d7188c3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ +dist: trusty language: elixir -sudo: false matrix: include: - elixir: 1.8 diff --git a/test/connection_test.exs b/test/connection_test.exs index 91fd64b..ad13426 100644 --- a/test/connection_test.exs +++ b/test/connection_test.exs @@ -74,7 +74,6 @@ defmodule Rabbit.ConnectionTest do end end - @tag capture_log: true test "will reconnect when connection stops" do assert {:ok, connection} = Connection.start_link(TestConnection) assert :ok = Connection.subscribe(connection) @@ -99,6 +98,7 @@ defmodule Rabbit.ConnectionTest do end) Task.await(task) + :timer.sleep(50) state = GenServer.call(connection, :state) refute Map.has_key?(state.monitors, task.pid) @@ -117,6 +117,7 @@ defmodule Rabbit.ConnectionTest do end) Task.await(task) + :timer.sleep(50) state = GenServer.call(connection, :state) refute MapSet.member?(state.subscribers, task.pid) diff --git a/test/consumer_supervisor_test.exs b/test/consumer_supervisor_test.exs index bfd90ab..e8751ec 100644 --- a/test/consumer_supervisor_test.exs +++ b/test/consumer_supervisor_test.exs @@ -55,7 +55,7 @@ defmodule Rabbit.ConsumerSupervisorTest do end end - setup do + setup_all do {:ok, connection} = Connection.start_link(TestConnection, [], name: TestConnection) %{connection: connection} end diff --git a/test/consumer_test.exs b/test/consumer_test.exs index 192dc6a..76358ae 100644 --- a/test/consumer_test.exs +++ b/test/consumer_test.exs @@ -85,7 +85,6 @@ defmodule Rabbit.ConsumerTest do end end - @tag capture_log: true test "will reconnect when connection stops", meta do assert {:ok, consumer, _queue} = start_consumer(meta) diff --git a/test/producer_test.exs b/test/producer_test.exs index 7e2183c..aaefe99 100644 --- a/test/producer_test.exs +++ b/test/producer_test.exs @@ -62,6 +62,8 @@ defmodule Rabbit.ProducerTest do assert Process.alive?(state.channel.pid) assert :ok = Producer.stop(producer) + :timer.sleep(50) + refute Process.alive?(state.channel.pid) end end @@ -86,7 +88,6 @@ defmodule Rabbit.ProducerTest do end end - @tag capture_log: true test "will reconnect when connection stops" do {:ok, amqp_conn} = AMQP.Connection.open() {:ok, amqp_chan} = AMQP.Channel.open(amqp_conn) diff --git a/test/test_helper.exs b/test/test_helper.exs index 869559e..e664654 100644 --- a/test/test_helper.exs +++ b/test/test_helper.exs @@ -1 +1,3 @@ +Logger.remove_backend(:console) + ExUnit.start()