rabbit_ct_helpers: Use timer:send_after/2 instead of erlang:start_timer/4

It looks like the message sent by erlang:start_timer/4 conflicts without
something else, perhaps inside common_test.

Hopefully, by using timer:send_after/2 and thus another message format,
the possible conflict will go away.
This commit is contained in:
Jean-Sébastien Pédron 2020-11-24 12:15:22 +01:00
parent 762e35cee6
commit d8bb5d2484
1 changed files with 4 additions and 3 deletions

View File

@ -856,7 +856,7 @@ port_receive_loop(Port, Stdout, Options, Until, DumpTimer) ->
end,
receive
{Port, {exit_status, X}} ->
erlang:cancel_timer(DumpTimer),
timer:cancel(DumpTimer),
DropStdout = lists:member(drop_stdout, Options) orelse
Stdout =:= "",
if
@ -879,7 +879,7 @@ port_receive_loop(Port, Stdout, Options, Until, DumpTimer) ->
nomatch -> {error, X, Stdout}
end
end;
{timeout, DumpTimer, _} ->
dump_output ->
DropStdout = lists:member(drop_stdout, Options) orelse
Stdout =:= "",
if
@ -898,7 +898,8 @@ port_receive_loop(Port, Stdout, Options, Until, DumpTimer) ->
end.
stdout_dump_timer() ->
erlang:start_timer(30000, self(), dump_output, []).
{ok, TRef} = timer:send_after(30000, dump_output),
TRef.
make(Config, Dir, Args) ->
make(Config, Dir, Args, []).