Skip to content

Commit

Permalink
test: disable prevent_overlapping_partitions during test (#172)
Browse files Browse the repository at this point in the history
During test, we are starting and stopping a ton of nodes and it's
getting a little wild and OTP is rightfully trying to help, but since
we're in test, and those nodes are not going to try to talk to each
other, it's more of a hindurance.
  • Loading branch information
mhanberg committed Aug 13, 2023
1 parent ebe2ea3 commit 666e3cb
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 14 deletions.
3 changes: 2 additions & 1 deletion .dialyzer_ignore.exs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[
{"lib/next_ls/lsp_supervisor.ex", :exact_eq}
{"lib/next_ls/lsp_supervisor.ex", :exact_eq},
{"lib/next_ls/runtime.ex", :exact_eq}
]
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
run: rm -rf tmp

- name: Run Tests
run: mix test
run: elixir --erl '-kernel prevent_overlapping_partitions false' -S mix test

formatter:
runs-on: ubuntu-latest
Expand Down
32 changes: 20 additions & 12 deletions lib/next_ls/runtime.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ defmodule NextLS.Runtime do
@moduledoc false
use GenServer

@env Mix.env()

def start_link(opts) do
GenServer.start_link(__MODULE__, opts)
end
Expand Down Expand Up @@ -91,18 +93,24 @@ defmodule NextLS.Runtime do
{~c"RELEASE_SYS_CONFIG", false},
{~c"PATH", String.to_charlist(new_path)}
],
args: [
System.find_executable("elixir"),
"--no-halt",
"--sname",
sname,
"--cookie",
Node.get_cookie(),
"-S",
"mix",
"loadpaths",
"--no-compile"
]
args:
[System.find_executable("elixir")] ++
if @env == :test do
["--erl", "-kernel prevent_overlapping_partitions false"]
else
[]
end ++
[
"--no-halt",
"--sname",
sname,
"--cookie",
Node.get_cookie(),
"-S",
"mix",
"loadpaths",
"--no-compile"
]
]
)

Expand Down

0 comments on commit 666e3cb

Please sign in to comment.