Skip to content

Commit 36f49cb

Browse files
committed
Set supervisor request timeout to infinity
Match OTP behavior and set timeout to infinity. This may reduce some test flappiness related to distribution Signed-off-by: Paul Guyot <pguyot@kallisys.net>
1 parent 56c2138 commit 36f49cb

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

libs/estdlib/src/supervisor.erl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -158,23 +158,23 @@ start_link(SupName, Module, Args) ->
158158

159159
-spec start_child(Supervisor :: sup_ref(), ChildSpec :: child_spec()) -> startchild_ret().
160160
start_child(Supervisor, ChildSpec) ->
161-
gen_server:call(Supervisor, {start_child, ChildSpec}).
161+
gen_server:call(Supervisor, {start_child, ChildSpec}, infinity).
162162

163163
-spec terminate_child(Supervisor :: sup_ref(), ChildId :: any()) -> ok | {error, not_found}.
164164
terminate_child(Supervisor, ChildId) ->
165-
gen_server:call(Supervisor, {terminate_child, ChildId}).
165+
gen_server:call(Supervisor, {terminate_child, ChildId}, infinity).
166166

167167
-spec restart_child(Supervisor :: sup_ref(), ChildId :: any()) ->
168168
{ok, Child :: child()}
169169
| {ok, Child :: child(), Info :: term()}
170170
| {error, Reason :: running | restarting | not_found | term()}.
171171
restart_child(Supervisor, ChildId) ->
172-
gen_server:call(Supervisor, {restart_child, ChildId}).
172+
gen_server:call(Supervisor, {restart_child, ChildId}, infinity).
173173

174174
-spec delete_child(Supervisor :: sup_ref(), ChildId :: any()) ->
175175
ok | {error, Reason :: running | restarting | not_found}.
176176
delete_child(Supervisor, ChildId) ->
177-
gen_server:call(Supervisor, {delete_child, ChildId}).
177+
gen_server:call(Supervisor, {delete_child, ChildId}, infinity).
178178

179179
-spec which_children(Supervisor :: sup_ref()) ->
180180
[
@@ -186,7 +186,7 @@ delete_child(Supervisor, ChildId) ->
186186
}
187187
].
188188
which_children(Supervisor) ->
189-
gen_server:call(Supervisor, which_children).
189+
gen_server:call(Supervisor, which_children, infinity).
190190

191191
-spec count_children(Supervisor :: sup_ref()) ->
192192
[
@@ -196,7 +196,7 @@ which_children(Supervisor) ->
196196
| {workers, ChildWorkerCount :: non_neg_integer()}
197197
].
198198
count_children(Supervisor) ->
199-
gen_server:call(Supervisor, count_children).
199+
gen_server:call(Supervisor, count_children, infinity).
200200

201201
% @hidden
202202
-spec init({Mod :: module(), Args :: [any()]}) ->

0 commit comments

Comments
 (0)