-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extend message receive timeout in tests to make up for Travis slowness
- Loading branch information
Rafal Studnicki
authored and
Simon Zelazny
committed
Jun 8, 2017
1 parent
55b2bac
commit 10324f2
Showing
1 changed file
with
10 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,8 @@ defmodule Phoenix.PubSub.PG2Test do | |
@node1 :"[email protected]" | ||
@node2 :"[email protected]" | ||
|
||
@receive_timeout 200 | ||
|
||
setup config do | ||
size = config[:pool_size] || 1 | ||
if config[:pool_size] do | ||
|
@@ -29,15 +31,15 @@ defmodule Phoenix.PubSub.PG2Test do | |
|
||
PubSub.subscribe(config.pubsub, config.topic) | ||
:ok = PubSub.direct_broadcast(@node1, config.pubsub, config.topic, :ping) | ||
assert_receive {@node1, :ping} | ||
assert_receive {@node1, :ping}, @receive_timeout | ||
:ok = PubSub.direct_broadcast!(@node1, config.pubsub, config.topic, :ping) | ||
assert_receive {@node1, :ping} | ||
assert_receive {@node1, :ping}, @receive_timeout | ||
|
||
:ok = PubSub.direct_broadcast(@node2, config.pubsub, config.topic, :ping) | ||
refute_receive {@node1, :ping} | ||
refute_receive {@node1, :ping}, @receive_timeout | ||
|
||
:ok = PubSub.direct_broadcast!(@node2, config.pubsub, config.topic, :ping) | ||
refute_receive {@node1, :ping} | ||
refute_receive {@node1, :ping}, @receive_timeout | ||
end | ||
|
||
@tag pool_size: size, topic: topic | ||
|
@@ -46,15 +48,15 @@ defmodule Phoenix.PubSub.PG2Test do | |
|
||
PubSub.subscribe(config.pubsub, config.topic) | ||
:ok = PubSub.direct_broadcast_from(@node1, config.pubsub, self(), config.topic, :ping) | ||
assert_receive {@node1, :ping} | ||
assert_receive {@node1, :ping}, @receive_timeout | ||
:ok = PubSub.direct_broadcast_from!(@node1, config.pubsub, self(), config.topic, :ping) | ||
assert_receive {@node1, :ping} | ||
assert_receive {@node1, :ping}, @receive_timeout | ||
|
||
:ok = PubSub.direct_broadcast_from(@node2, config.pubsub, self(), config.topic, :ping) | ||
refute_receive {@node1, :ping} | ||
refute_receive {@node1, :ping}, @receive_timeout | ||
|
||
:ok = PubSub.direct_broadcast_from!(@node2, config.pubsub, self(), config.topic, :ping) | ||
refute_receive {@node1, :ping} | ||
refute_receive {@node1, :ping}, @receive_timeout | ||
end | ||
end | ||
|
||
|