Skip to content

Commit d4fda59

Browse files
dumbbellmergify[bot]
authored andcommitted
rabbitmq_peer_discovery_consul: Log output from Consul daemon
[Why] It helps diagnose any startup issues. Typically a problem with the configuration where the log file is not yet created. (cherry picked from commit b03f0bd)
1 parent 9295261 commit d4fda59

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

deps/rabbitmq_peer_discovery_consul/test/system_SUITE.erl

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,19 @@ start_consul(Config) ->
202202
Cmd = [ConsulBin, "agent",
203203
"-config-dir", ConsulConfDir,
204204
"-log-file", LogFile],
205-
ConsulPid = spawn(fun() -> rabbit_ct_helpers:exec(Cmd) end),
205+
ConsulPid = spawn(fun() -> do_start_consul(Cmd) end),
206206
rabbit_ct_helpers:set_config(Config, {consul_pid, ConsulPid}).
207207

208+
do_start_consul(Cmd) ->
209+
case rabbit_ct_helpers:exec(Cmd) of
210+
{ok, Stdout} ->
211+
ct:pal("Consul daemon exited:~n~s", [Stdout]);
212+
{error, Reason, Stdout} ->
213+
ct:pal(
214+
"Consul daemon exited with error ~0p:~n~s",
215+
[Reason, Stdout])
216+
end.
217+
208218
stop_consul(Config) ->
209219
case rabbit_ct_helpers:get_config(Config, consul_pid) of
210220
ConsulPid when is_pid(ConsulPid) ->

0 commit comments

Comments
 (0)