Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test cases #94

Merged
merged 16 commits into from
Sep 6, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix Distributed test; remove debug tracing
  • Loading branch information
Arjan Scherpenisse committed Jul 22, 2018
commit 3c4bd0434296b8715c925d12e5170b4b712bd991
3 changes: 2 additions & 1 deletion config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use Mix.Config
config :swarm,
nodes: [:"[email protected]", :"[email protected]"],
sync_nodes_timeout: 0,
anti_entropy_interval: 5_000,
debug: false,
node_blacklist: [
# the following blacklists nodes set up by exrm/relx/distillery
Expand All @@ -19,7 +20,7 @@ config :swarm,
]

config :logger,
level: :info
level: :warn

config :porcelain,
goon_warn_if_missing: false
13 changes: 12 additions & 1 deletion test/distributed_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,19 @@ defmodule Swarm.DistributedTests do

setup_all do
:rand.seed(:exs64)
:net_kernel.stop()
{:ok, _} = :net_kernel.start([:swarm_master, :shortnames])
Node.set_cookie(:swarm_test)

on_exit(fn ->
:net_kernel.stop()
exclude = Keyword.get(ExUnit.configuration(), :exclude, [])

unless :clustered in exclude do
:net_kernel.start([:"[email protected]"])
end
end)

:ok
end

Expand Down Expand Up @@ -100,7 +111,7 @@ defmodule Swarm.DistributedTests do
# IO.puts "node2 reconnected"

# give time to sync
Process.sleep(30_000)
Process.sleep(5_000)

# make sure processes are back in the correct place
procs
Expand Down
4 changes: 2 additions & 2 deletions test/support/sys.config
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[{swarm, [{debug, true}, {node_blacklist, [<<"swarm_master@.*">>]}, {debug_opts, [trace]}]},
{logger, [{level, debug}]}].
[{swarm, [{node_blacklist, [<<"swarm_master@.*">>]}]},
{logger, [{level, debug}]}].
2 changes: 1 addition & 1 deletion test/tracker_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ defmodule Swarm.TrackerTests do
setup_all do
:rand.seed(:exs64)
Application.ensure_all_started(:swarm)
{:ok, _} = MyApp.WorkerSup.start_link()
MyApp.WorkerSup.start_link()
:ok
end

Expand Down