fix: start epmd before net_kernel in split_dc_SUITE; ci: epmd -daemon

split_dc_SUITE requires Erlang distribution (peer module). On GitHub
Actions (and any fresh environment) epmd is not pre-started, causing
net_kernel:start to fail with nodistribution.

Fix: call os:cmd("epmd -daemon") before net_kernel:start in
init_per_suite. The call is idempotent — safe when epmd is already
running.

Also start epmd explicitly in the CI 'ct' step as a belt-and-suspenders
measure.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Sergey Prokhorov 2026-04-12 00:39:02 +02:00
parent 121d8b7413
commit d5f5a74de5
No known key found for this signature in database
GPG key ID: 1C570244E4EF3337
2 changed files with 4 additions and 2 deletions

View file

@ -45,7 +45,7 @@ jobs:
run: rebar3 eunit
- name: ct
run: rebar3 ct
run: epmd -daemon && rebar3 ct
- name: dialyzer
run: rebar3 dialyzer

View file

@ -38,7 +38,9 @@ init_per_suite(Cfg) ->
{ok, _} = application:ensure_all_started(inets),
{ok, _} = application:ensure_all_started(ranch),
%% peer:start_link requires the current node to be distributed.
%% Start distribution if rebar3 ct didn't already do so.
%% Start EPMD daemon first (no-op if already running), then enable
%% distribution if rebar3 ct didn't already do so.
os:cmd("epmd -daemon"),
Distributed =
case net_kernel:start([split_dc_test, shortnames]) of
{ok, _} -> true;