This repository has been archived by the owner on Jan 29, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove connect and disconnect from the topology
- Loading branch information
José Valim
committed
Dec 10, 2018
1 parent
0f3e7b8
commit 75ecb36
Showing
3 changed files
with
7 additions
and
138 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
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
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 |
---|---|---|
|
@@ -110,38 +110,6 @@ defmodule Firenest.TopologyTest do | |
end | ||
end | ||
|
||
describe "connection" do | ||
@describetag :connection | ||
|
||
@node :"[email protected]" | ||
test "may be set and managed explicitly", %{topology: topology} do | ||
# No node yet | ||
refute T.disconnect(topology, @node) | ||
refute @node in Keyword.keys(T.nodes(topology)) | ||
|
||
# Start the node but not firenest | ||
Firenest.Test.spawn_nodes([@node]) | ||
refute @node in Keyword.keys(T.nodes(topology)) | ||
|
||
# Finally start firenest | ||
Firenest.Test.start_firenest([@node], adapter: T.adapter!(topology)) | ||
assert T.connect(topology, @node) | ||
assert @node in Keyword.keys(T.nodes(topology)) | ||
|
||
# Connect should still return true | ||
assert T.connect(topology, @node) | ||
|
||
# Now let's diconnect | ||
assert T.disconnect(topology, @node) | ||
refute @node in Keyword.keys(T.nodes(topology)) | ||
|
||
# And we can't connect it back because it is permanently down | ||
refute T.connect(topology, @node) | ||
after | ||
T.disconnect(topology, @node) | ||
end | ||
end | ||
|
||
describe "sync_named/2" do | ||
@describetag :sync_named | ||
|
||
|
@@ -208,8 +176,9 @@ defmodule Firenest.TopologyTest do | |
start_sync_named_on(topology, node_ref, evaluator, test) | ||
assert_receive {:named_up, ^node_ref, ^test} | ||
|
||
# And now let's disconnect from it | ||
assert T.disconnect(topology, @node) | ||
# And now let's shut it down | ||
cmd = quote do: System.halt(0) | ||
T.send(topology, node_ref, evaluator, {:eval_quoted, cmd}) | ||
assert_receive {:named_down, ^node_ref, ^test} | ||
|
||
# And now let's kill the named process running on third | ||
|