Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #5 from nsweeting/v0.3
v0.3 to master
  • Loading branch information
nsweeting committed Jun 14, 2019
2 parents 458de11 + be752a6 commit 22569b6
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
@@ -1,5 +1,5 @@
dist: trusty
language: elixir
sudo: false
matrix:
include:
- elixir: 1.8
Expand Down
3 changes: 2 additions & 1 deletion test/connection_test.exs
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion test/consumer_supervisor_test.exs
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion test/consumer_test.exs
Expand Up @@ -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)

Expand Down
3 changes: 2 additions & 1 deletion test/producer_test.exs
Expand Up @@ -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
Expand All @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions test/test_helper.exs
@@ -1 +1,3 @@
Logger.remove_backend(:console)

ExUnit.start()

0 comments on commit 22569b6

Please sign in to comment.